reports GC stats in qps workers

pull/10876/head
Jan Tattermusch 8 years ago
parent cf7ea0f089
commit 01ce23641d
  1. 3
      src/csharp/Grpc.IntegrationTesting/ClientRunners.cs
  2. 5
      src/csharp/Grpc.IntegrationTesting/QpsWorker.cs
  3. 3
      src/csharp/Grpc.IntegrationTesting/ServerRunners.cs

@ -179,6 +179,9 @@ namespace Grpc.IntegrationTesting
statsResetCount.Increment();
}
GrpcEnvironment.Logger.Info("[ClientRunnerImpl.GetStats] GC collection counts: gen0 {0}, gen1 {1}, gen2 {2}, gen3 {3} (histogram reset count:{4}, seconds since reset: {5})",
GC.CollectionCount(0), GC.CollectionCount(1), GC.CollectionCount(2), GC.CollectionCount(3), statsResetCount.Count, secondsElapsed);
// TODO: populate user time and system time
return new ClientStats
{

@ -95,10 +95,13 @@ namespace Grpc.IntegrationTesting
Ports = { new ServerPort(host, options.DriverPort, ServerCredentials.Insecure )}
};
int boundPort = server.Ports.Single().BoundPort;
Console.WriteLine("Running qps worker server on " + string.Format("{0}:{1}", host, boundPort));
GrpcEnvironment.Logger.Info("Running qps worker server on {0}:{1}", host, boundPort);
server.Start();
await tcs.Task;
await server.ShutdownAsync();
GrpcEnvironment.Logger.Info("GC collection counts (after shutdown): gen0 {0}, gen1 {1}, gen2 {2}, gen3 {3}",
GC.CollectionCount(0), GC.CollectionCount(1), GC.CollectionCount(2), GC.CollectionCount(3));
}
}
}

@ -154,6 +154,9 @@ namespace Grpc.IntegrationTesting
{
var secondsElapsed = wallClockStopwatch.GetElapsedSnapshot(reset).TotalSeconds;
GrpcEnvironment.Logger.Info("[ServerRunner.GetStats] GC collection counts: gen0 {0}, gen1 {1}, gen2 {2}, gen3 {3} (seconds since last reset {4})",
GC.CollectionCount(0), GC.CollectionCount(1), GC.CollectionCount(2), GC.CollectionCount(3), secondsElapsed);
// TODO: populate user time and system time
return new ServerStats
{

Loading…
Cancel
Save