/// <summary> /// Log a CloudWatch metric. The metric is picked up by CloudWatch logs and automatically ingested as a CloudWatch metric. /// </summary> /// <param name="name">Metric name.</param> /// <param name="value">Metric value.</param> /// <param name="unit">Metric unit.</param> /// <param name="dimensionNames">Metric dimensions as comma-separated list (e.g. [ "A", "A,B" ]).</param> /// <param name="dimensionValues">Dictionary of dimesion name-value pairs.</param> protected void LogMetric( string name, double value, LambdaMetricUnit unit, IEnumerable <string> dimensionNames, Dictionary <string, string> dimensionValues ) => AppClient.LogMetric(name, value, unit, dimensionNames, dimensionValues);
/// <summary> /// Log a CloudWatch metric. The metric is picked up by CloudWatch logs and automatically ingested as a CloudWatch metric. /// </summary> /// <param name="logger">The <see cref="ILambdaSharpLogger"/> instance to use.</param> /// <param name="name">Metric name.</param> /// <param name="value">Metric value.</param> /// <param name="unit">Metric unit.</param> /// <param name="dimensionNames">Metric dimensions as comma-separated list (e.g. [ "A", "A,B" ]).</param> /// <param name="dimensionValues">Dictionary of dimesion name-value pairs.</param> public static void LogMetric( this ILambdaSharpLogger logger, string name, double value, LambdaMetricUnit unit, IEnumerable <string> dimensionNames, Dictionary <string, string> dimensionValues ) => logger.LogMetric(new[] { new LambdaMetric(name, value, unit) }, dimensionNames, dimensionValues);
//--- Extension Methods --- /// <summary> /// Log a CloudWatch metric. The metric is picked up by CloudWatch logs and automatically ingested as a CloudWatch metric. /// </summary> /// <param name="logger">The <see cref="ILambdaSharpLogger"/> instance to use.</param> /// <param name="name">Metric name.</param> /// <param name="value">Metric value.</param> /// <param name="unit">Metric unit.</param> public static void LogMetric( this ILambdaSharpLogger logger, string name, double value, LambdaMetricUnit unit ) => logger.LogMetric(new[] { new LambdaMetric(name, value, unit) });
/// <summary> /// Log a CloudWatch metric. The metric is picked up by CloudWatch logs and automatically ingested as a CloudWatch metric. /// </summary> /// <param name="name">Metric name.</param> /// <param name="value">Metric value.</param> /// <param name="unit">Metric unit.</param> protected void LogMetric( string name, double value, LambdaMetricUnit unit ) => AppClient.LogMetric(name, value, unit);