Beispiel #1
0
 void OnMethodExecuted(RequestMetrics metrics)
 {
     if (ExecutedMethodCallback != null)
     {
         ExecutedMethodCallback(this, metrics);
     }
 }
Beispiel #2
0
        //Callback method to log requests execution metrics.
        static void MethodExecuted(object sender, RequestMetrics metrics)
        {
            SemantriaWorker worker = sender as SemantriaWorker;

            if (metrics.ExecutedMethod == SemantriaAPImethod.QueueBatch)
            {
                int batchSize = (int)metrics.State;
                WriteLogLine("Worker {0}: A batch of {1} documents has been queued in {2:0.##} seconds.", worker.WorkerId, batchSize, metrics.ExecutionTime.TotalSeconds);
            }
            else if (metrics.ExecutedMethod == SemantriaAPImethod.RetrieveResultsByJobId)
            {
                int batchSize = (int)metrics.State;
                WriteLogLine("Worker {0}: A batch of {1} documents has been retrieved in {2:0.##} seconds.", worker.WorkerId, batchSize, metrics.ExecutionTime.TotalSeconds);
            }
        }
 void OnMethodExecuted(RequestMetrics metrics)
 {
     if (ExecutedMethodCallback != null)
     {
         ExecutedMethodCallback(this, metrics);
     }
 }