public Tag(TagKeys key, string value)
 {
     Key   = key;
     Value = value;
 }
Exemplo n.º 2
0
        public async Task<TagKeys> GetTagKeysAsync(string databaseName, string measurement = null)
        {
            ThrowIfDisposed();

            Ensure.That(databaseName, nameof(databaseName)).IsNotNullOrWhiteSpace();

            var result = new TagKeys();

            var json = await GetTagKeysJsonAsync(databaseName, measurement).ForAwait();
            var data = Requester.JsonSerializer.Deserialize<InfluxDbResponse>(json);
            if (data?.Results == null || !data.Results.Any())
                return result;

            foreach (var serie in data.Results.SelectMany(r => r.Series))
                result.Add(serie.Name, serie.Values.Select(value => value.First.ToObject<string>()).ToArray());

            return result;
        }