Пример #1
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <GetLogResponse> GetLogAsync(this IMetricsAPI operations, string name, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetLogWithHttpMessagesAsync(name, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #2
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <KeyValueModel> > GetKeyValuesAsync(this IMetricsAPI operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetKeyValuesWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #3
0
 /// <summary>
 /// Checks service is alive
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IsAliveResponse> IsAliveAsync(this IMetricsAPI operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.IsAliveWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Пример #4
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <string> GetLogNames(this IMetricsAPI operations)
 {
     return(operations.GetLogNamesAsync().GetAwaiter().GetResult());
 }
Пример #5
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='data'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task SaveKeyValuesAsync(this IMetricsAPI operations, IList <KeyValueModel> data = default(IList <KeyValueModel>), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.SaveKeyValuesWithHttpMessagesAsync(data, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #6
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='data'>
 /// </param>
 public static void SaveKeyValues(this IMetricsAPI operations, IList <KeyValueModel> data = default(IList <KeyValueModel>))
 {
     operations.SaveKeyValuesAsync(data).GetAwaiter().GetResult();
 }
Пример #7
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IList <KeyValueModel> GetKeyValues(this IMetricsAPI operations)
 {
     return(operations.GetKeyValuesAsync().GetAwaiter().GetResult());
 }
Пример #8
0
 /// <summary>
 /// Checks service is alive
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 public static IsAliveResponse IsAlive(this IMetricsAPI operations)
 {
     return(operations.IsAliveAsync().GetAwaiter().GetResult());
 }
Пример #9
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task AddLogEntryAsync(this IMetricsAPI operations, AddLogEntryModel model = default(AddLogEntryModel), CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.AddLogEntryWithHttpMessagesAsync(model, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
Пример #10
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='model'>
 /// </param>
 public static void AddLogEntry(this IMetricsAPI operations, AddLogEntryModel model = default(AddLogEntryModel))
 {
     operations.AddLogEntryAsync(model).GetAwaiter().GetResult();
 }
Пример #11
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='name'>
 /// </param>
 public static GetLogResponse GetLog(this IMetricsAPI operations, string name)
 {
     return(operations.GetLogAsync(name).GetAwaiter().GetResult());
 }
Пример #12
0
 public KeyValueMetricsClient(IMetricsAPI service)
 {
     _service = service;
 }