Пример #1
0
 /// <summary>
 /// Observer of IDriverMetrics.
 /// When Driver metrics data is changed, this method will be called.
 /// It calls Sink to store/log the metrics data.
 /// </summary>
 /// <param name="driverMetrics">driver metrics data.</param>
 public void OnNext(IDriverMetrics driverMetrics)
 {
     Sink(new Dictionary <string, string>()
     {
         { "SystemState", driverMetrics.SystemState },
         { "TimeUpdated", driverMetrics.TimeUpdated.ToLongTimeString() }
     });
 }
Пример #2
0
        public void OnNext(IDriverStarted value)
        {
            _driverMetrics = new DriverMetrics();
            UpdateMetrics(TestSystemState.DriverStarted);

            var request =
                _evaluatorRequestor.NewBuilder()
                .SetNumber(1)
                .SetMegabytes(512)
                .SetCores(2)
                .SetRackName("WonderlandRack")
                .SetEvaluatorBatchId("MetricsEvaluator")
                .Build();

            _evaluatorRequestor.Submit(request);
        }
Пример #3
0
 /// <summary>
 /// Utility method that wraps a call to <see cref="IDriverMetrics.GetSessionMetric{TMetricType}"/> with the appropriate AppMetrics based counter type
 /// as the type parameter. For more information see the API docs of <see cref="IDriverMetrics.GetSessionMetric{TMetricType}"/>.
 /// </summary>
 public static IAppMetricsCounter GetSessionCounter(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
 {
     MetricsExtensions.ThrowIfNull(driverMetrics, sessionMetric);
     return(driverMetrics.GetSessionMetric <IAppMetricsCounter>(sessionMetric));
 }
Пример #4
0
 /// <summary>
 /// Utility method that wraps a call to <see cref="IDriverMetrics.GetNodeMetric{TMetricType}"/> with the appropriate AppMetrics based timer type
 /// as the type parameter. For more information see the API docs of <see cref="IDriverMetrics.GetNodeMetric{TMetricType}"/>.
 /// </summary>
 public static IAppMetricsTimer GetNodeTimer(this IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
 {
     MetricsExtensions.ThrowIfNull(driverMetrics, host, nodeMetric);
     return(driverMetrics.GetNodeMetric <IAppMetricsTimer>(host, nodeMetric));
 }
Пример #5
0
 private static void ThrowIfNull(IDriverMetrics driverMetrics, Host host, NodeMetric nodeMetric)
 {
     MetricsExtensions.ThrowIfNull(driverMetrics, nameof(driverMetrics));
     MetricsExtensions.ThrowIfNull(host, nameof(host));
     MetricsExtensions.ThrowIfNull(nodeMetric, nameof(nodeMetric));
 }
Пример #6
0
 private static void ThrowIfNull(IDriverMetrics driverMetrics, SessionMetric sessionMetric)
 {
     MetricsExtensions.ThrowIfNull(driverMetrics, nameof(driverMetrics));
     MetricsExtensions.ThrowIfNull(sessionMetric, nameof(sessionMetric));
 }
Пример #7
0
 /// <summary>
 /// Utility method that wraps a call to <see cref="IDriverMetrics.GetSessionMetric{TMetricType}"/> with the appropriate AppMetrics based gauge type
 /// as the type parameter. For more information see the API docs of <see cref="IDriverMetrics.GetSessionMetric{TMetricType}"/>.
 /// </summary>
 public static IAppMetricsGauge GetSessionGauge(this IDriverMetrics driverMetrics, SessionMetric sessionMetric)
 {
     MetricsExtensions.ThrowIfNull(driverMetrics, sessionMetric);
     return(driverMetrics.GetSessionMetric <IAppMetricsGauge>(sessionMetric));
 }
Пример #8
0
 /// <summary>
 /// Observer of IDriverMetrics.
 /// Called when Driver metrics data is changed.
 /// </summary>
 /// <param name="driverMetrics">driver metrics data.</param>
 public void OnNext(IDriverMetrics driverMetrics)
 {
     Sink(driverMetrics.GetMetricsData().FlushMetricRecords());
 }