예제 #1
0
        public static DoubleMetric MetricFromEmpty <S, T>(Analyzer <S, T> analyzer, string name, string instance,
                                                          MetricEntity metricEntity = MetricEntity.Column) where S : State <S>, IState where T : IMetric
        {
            EmptyStateException emptyState =
                new EmptyStateException($"Empty state for analyzer {analyzer}, all input values were NULL.");

            return(DoubleMetric.Create(metricEntity, name, instance,
                                       new Try <double>(ExceptionExt.WrapIfNecessary(emptyState))));
        }
예제 #2
0
 public static DoubleMetric MetricFromFailure(Exception exception, string name, string instance,
                                              MetricEntity metricEntity = MetricEntity.Column) =>
 DoubleMetric.Create(metricEntity, name, instance,
                     new Try <double>(ExceptionExt.WrapIfNecessary(exception)));