diff options
author | Diva Canto | 2013-07-11 16:43:43 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-11 16:43:43 -0700 |
commit | 83d1680057419229b0708bde59b12159006195cd (patch) | |
tree | 6b066a58cc1dac69b5232edeefcb03d4bf30b28b /OpenSim/Tests/Clients/Assets/AssetsClient.cs | |
parent | Added property to make for more flexible testing. (diff) | |
download | opensim-SC_OLD-83d1680057419229b0708bde59b12159006195cd.zip opensim-SC_OLD-83d1680057419229b0708bde59b12159006195cd.tar.gz opensim-SC_OLD-83d1680057419229b0708bde59b12159006195cd.tar.bz2 opensim-SC_OLD-83d1680057419229b0708bde59b12159006195cd.tar.xz |
Added a few more thingies to the asset client test to poke the threadpool.
Diffstat (limited to 'OpenSim/Tests/Clients/Assets/AssetsClient.cs')
-rw-r--r-- | OpenSim/Tests/Clients/Assets/AssetsClient.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Tests/Clients/Assets/AssetsClient.cs b/OpenSim/Tests/Clients/Assets/AssetsClient.cs index dd168a1..26d740b 100644 --- a/OpenSim/Tests/Clients/Assets/AssetsClient.cs +++ b/OpenSim/Tests/Clients/Assets/AssetsClient.cs | |||
@@ -82,7 +82,16 @@ namespace OpenSim.Tests.Clients.AssetsClient | |||
82 | m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); | 82 | m_log.InfoFormat("[ASSET CLIENT]: [{0}] requested asset {1}", i, uuid); |
83 | } | 83 | } |
84 | 84 | ||
85 | Thread.Sleep(20 * 1000); | 85 | for (int i = 0; i < 500; i++) |
86 | { | ||
87 | var x = i; | ||
88 | ThreadPool.QueueUserWorkItem(delegate | ||
89 | { | ||
90 | Dummy(x); | ||
91 | }); | ||
92 | } | ||
93 | |||
94 | Thread.Sleep(30 * 1000); | ||
86 | m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); | 95 | m_log.InfoFormat("[ASSET CLIENT]: Received responses {0}", m_NReceived); |
87 | } | 96 | } |
88 | 97 | ||
@@ -92,8 +101,16 @@ namespace OpenSim.Tests.Clients.AssetsClient | |||
92 | m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; | 101 | m_MaxThreadID = Thread.CurrentThread.ManagedThreadId; |
93 | int max1, max2; | 102 | int max1, max2; |
94 | ThreadPool.GetAvailableThreads(out max1, out max2); | 103 | ThreadPool.GetAvailableThreads(out max1, out max2); |
95 | m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3})", id, m_MaxThreadID, max1, max2); | 104 | m_log.InfoFormat("[ASSET CLIENT]: Received asset {0} ({1}) ({2}-{3}) {4}", id, m_MaxThreadID, max1, max2, DateTime.Now.ToString("hh:mm:ss")); |
96 | m_NReceived++; | 105 | m_NReceived++; |
97 | } | 106 | } |
107 | |||
108 | private static void Dummy(int i) | ||
109 | { | ||
110 | int max1, max2; | ||
111 | ThreadPool.GetAvailableThreads(out max1, out max2); | ||
112 | m_log.InfoFormat("[ASSET CLIENT]: ({0}) Hello! {1} - {2} {3}", i, max1, max2, DateTime.Now.ToString("hh:mm:ss")); | ||
113 | Thread.Sleep(2000); | ||
114 | } | ||
98 | } | 115 | } |
99 | } | 116 | } |