Пример #1
0
        private static void AppendRUToStringBuilder(StringBuilder stringBuilder, string property, double requestCharge, int indentLevel)
        {
            const string RequestChargeFormatString = "{0:n2}";
            const string RequestChargeUnitString   = "RUs";

            QueryMetricsTextWriter.AppendToStringBuilder(
                stringBuilder,
                property,
                string.Format(CultureInfo.InvariantCulture, RequestChargeFormatString, requestCharge),
                RequestChargeUnitString,
                indentLevel);
        }
Пример #2
0
        private static void AppendTimeSpanToStringBuilder(StringBuilder stringBuilder, string property, TimeSpan timeSpan, int indentLevel)
        {
            const string MillisecondsFormatString = "{0:n2}";
            const string MillisecondsUnitString   = "milliseconds";

            QueryMetricsTextWriter.AppendToStringBuilder(
                stringBuilder,
                property,
                string.Format(CultureInfo.InvariantCulture, MillisecondsFormatString, timeSpan.TotalMilliseconds),
                MillisecondsUnitString,
                indentLevel);
        }
Пример #3
0
        private static void AppendCountToStringBuilder(StringBuilder stringBuilder, string property, long count, int indentLevel)
        {
            const string CountFormatString = "{0:n0}";
            const string CountUnitString   = "";

            QueryMetricsTextWriter.AppendToStringBuilder(
                stringBuilder,
                property,
                string.Format(CultureInfo.InvariantCulture, CountFormatString, count),
                CountUnitString,
                indentLevel);
        }
Пример #4
0
        private static void AppendPercentageToStringBuilder(StringBuilder stringBuilder, string property, double percentage, int indentLevel)
        {
            const string PercentageFormatString = "{0:n2}";
            const string PercentageUnitString   = "%";

            QueryMetricsTextWriter.AppendToStringBuilder(
                stringBuilder,
                property,
                string.Format(CultureInfo.InvariantCulture, PercentageFormatString, percentage * 100),
                PercentageUnitString,
                indentLevel);
        }
Пример #5
0
        private static void AppendBytesToStringBuilder(StringBuilder stringBuilder, string property, long bytes, int indentLevel)
        {
            const string BytesFormatString = "{0:n0}";
            const string BytesUnitString   = "bytes";

            QueryMetricsTextWriter.AppendToStringBuilder(
                stringBuilder,
                property,
                string.Format(CultureInfo.InvariantCulture, BytesFormatString, bytes),
                BytesUnitString,
                indentLevel);
        }