summaryrefslogtreecommitdiff
path: root/IvyPerf
diff options
context:
space:
mode:
authorfcolin2009-09-22 08:54:56 +0000
committerfcolin2009-09-22 08:54:56 +0000
commitdea54889df04d162e27d30d9a067920fc0de87ef (patch)
tree3aa72fb8b584c9c37d30548049883e7d6fb24794 /IvyPerf
parentfc9967263d5aaaa5511eac622404b76e4d1166eb (diff)
downloadivy-csharp-dea54889df04d162e27d30d9a067920fc0de87ef.zip
ivy-csharp-dea54889df04d162e27d30d9a067920fc0de87ef.tar.gz
ivy-csharp-dea54889df04d162e27d30d9a067920fc0de87ef.tar.bz2
ivy-csharp-dea54889df04d162e27d30d9a067920fc0de87ef.tar.xz
remove unused files
Diffstat (limited to 'IvyPerf')
-rw-r--r--IvyPerf/IvyPerf.cs49
-rw-r--r--IvyPerf/IvyPerf.csproj9
-rw-r--r--IvyPerf/IvyPerf_TemporaryKey.pfxbin1676 -> 0 bytes
3 files changed, 51 insertions, 7 deletions
diff --git a/IvyPerf/IvyPerf.cs b/IvyPerf/IvyPerf.cs
index 25afd6a..794ffd8 100644
--- a/IvyPerf/IvyPerf.cs
+++ b/IvyPerf/IvyPerf.cs
@@ -14,7 +14,15 @@ namespace IvyPerf
{
static Ivy bus;
static double origin = 0;
-
+ static int nbMsgReceive = 0;
+ static int nbMsgEmit = 0;
+ static int nbMsg = 10;
+
+
+ static double minRoundTrip = 1e12;
+ static double maxRoundTrip = 0;
+ static double averageRoundTrip = 0;
+
static double currentTime() // en ms
{
double time;
@@ -30,13 +38,33 @@ namespace IvyPerf
[IvyBinding("^pong ts=(.*) tr=(.*)")]
static void Pong(object sender, IvyMessageEventArgs args)
{
+ nbMsgReceive++;
+
double current = currentTime() - origin;
double ts = double.Parse(args[0], bus.Culture );
double tr = double.Parse(args[1], bus.Culture );
double roundtrip1 = tr - ts;
double roundtrip2 = current - tr;
double roundtrip3 = current - ts;
- Console.WriteLine("round trip {0} {1} {2}", roundtrip1, roundtrip2, roundtrip3);
+
+ if (roundtrip3 > 50)
+ Console.WriteLine("slow roundtrip[{0}] min {1} av {2} max {3} ms slow={4}", nbMsgReceive, minRoundTrip, averageRoundTrip, maxRoundTrip, roundtrip3);
+
+ if (roundtrip3 > maxRoundTrip)
+ {
+ maxRoundTrip = roundtrip3;
+ }
+ if ( roundtrip3 < minRoundTrip )
+ {
+ minRoundTrip = roundtrip3;
+ }
+ averageRoundTrip = (averageRoundTrip * ( nbMsgReceive - 1 ) + roundtrip3) /nbMsgReceive;
+
+ if ( nbMsg == nbMsgReceive )
+ {
+ Console.WriteLine("roundtrip[{0}] min {1} av {2} max {3} ms\n", nbMsgReceive, minRoundTrip, averageRoundTrip, maxRoundTrip);
+ //bus->Stop();
+ }
}
/// <summary>
/// Point d'entrée principal de l'application.
@@ -44,9 +72,12 @@ namespace IvyPerf
[STAThread]
static void Main(string[] args)
{
- int timeout = 1000;
+ int timeout = 200;
if (args.Length > 0)
timeout = int.Parse(args[0]);
+ if (args.Length > 1)
+ nbMsg = int.Parse(args[1]);
+
bus = new Ivy("IvyPerf", "IvyPref ready");
bus.SentMessageFilter.Add("ping");
bus.SentMessageFilter.Add("pong");
@@ -56,11 +87,19 @@ namespace IvyPerf
//bus.BindMsg("test", testtarget);
bus.Start(null);
origin = currentTime();
- while( true )
+ Console.WriteLine("Start Sending {0} messages...", nbMsg);
+ while( true )
{
Thread.Sleep( timeout );
int count = bus.SendMsg("ping ts={0}", currentTime() - origin );
- if ( count == 0 ) Console.Write( "." );
+ if (count != 0) nbMsgEmit++;
+ if (nbMsg == nbMsgEmit)
+ {
+ Console.WriteLine("... {0} messages sent ", nbMsg);
+ Thread.Sleep(timeout);
+ break;
+ }
+
}
}
diff --git a/IvyPerf/IvyPerf.csproj b/IvyPerf/IvyPerf.csproj
index 6ff143f..feaa087 100644
--- a/IvyPerf/IvyPerf.csproj
+++ b/IvyPerf/IvyPerf.csproj
@@ -31,8 +31,8 @@
<SccProvider>SAK</SccProvider>
<ManifestCertificateThumbprint>51C861139B0DCA6D2FAD5BDB1D5280AAE1E59696</ManifestCertificateThumbprint>
<ManifestKeyFile>IvyPerf_TemporaryKey.pfx</ManifestKeyFile>
- <GenerateManifests>true</GenerateManifests>
- <SignManifests>true</SignManifests>
+ <GenerateManifests>false</GenerateManifests>
+ <SignManifests>false</SignManifests>
<IsWebBootstrapper>true</IsWebBootstrapper>
<OldToolsVersion>2.0</OldToolsVersion>
<PublishUrl>\\samba\fcolin\public_html\ClickOnce\IvyPerf\</PublishUrl>
@@ -50,6 +50,8 @@
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
+ <TargetZone>LocalIntranet</TargetZone>
+ <ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug\</OutputPath>
@@ -140,6 +142,9 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
+ <ItemGroup>
+ <None Include="Properties\app.manifest" />
+ </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
diff --git a/IvyPerf/IvyPerf_TemporaryKey.pfx b/IvyPerf/IvyPerf_TemporaryKey.pfx
deleted file mode 100644
index db02b60..0000000
--- a/IvyPerf/IvyPerf_TemporaryKey.pfx
+++ /dev/null
Binary files differ