Esempio n. 1
0
def executeQuery( query, start_time, query_granularity, end_time):
    global client
    if client == None:
        client = createWavefrontClient()
    query_api = wave_api.QueryApi(client)
    result = query_api.query_api(dequote(query), str(start_time), query_granularity, e=str(end_time))
    return result
Esempio n. 2
0
def executeQuery( query, start_time, query_granularity, end_time):
    global client
    if client == None:
        client = createWavefrontClient()
    query_api = wave_api.QueryApi(client)
    #replace endtime with current time
    result = query_api.query_api(dequote(query), str(start_time), query_granularity, e=str(getNowInSeconds()))
    return result
Esempio n. 3
0
def executeQuery(appname, query, client, start_time, end_time,
                 query_granularity):
    query_api = wave_api.QueryApi(client)
    app_query = retrieveQueryUrl(appname, query)
    result = query_api.query_api(query,
                                 str(start_time),
                                 query_granularity,
                                 e=str(end_time))
    return formatData(result)
Esempio n. 4
0
 def __init__(self, query):
     '''
     query: str: WF query
     '''
     super(WavefrontScraper, self).__init__()
     config = wave_api.Configuration()
     config.host = base_url
     client = wave_api.ApiClient(configuration=config,
                                 header_name='Authorization',
                                 header_value='Bearer ' + api_key)
     self.query_api = wave_api.QueryApi(client)
     self.query = query
     # query by minute
     self.interval = 'm'
Esempio n. 5
0
from __future__ import print_function
import wavefront_api_client
from wavefront_api_client.rest import ApiException
from benchmark.utils import response_tostats, RuntimeObjects
from enum import Enum, auto
import pandas as pd
import numpy as np
from urllib3.exceptions import MaxRetryError

prod_config = wavefront_api_client.Configuration()
prod_config.host = "https://varca.wavefront.com"
prod_config.api_key['X-AUTH-TOKEN'] = '10a79735-3ed2-4cbd-bb3b-5ddecf2a06f7'
# create an instance of the API class
prod_api_instance = wavefront_api_client.QueryApi(wavefront_api_client.ApiClient(prod_config))

try:
    symphony_config = wavefront_api_client.Configuration()
    symphony_config.host = "https://symphony.wavefront.com"
    symphony_config.api_key['X-AUTH-TOKEN'] = 'e2b2f93e-0ce4-4757-8f4d-2a67e41ac57a'

    symphony_api_instance = wavefront_api_client.QueryApi(wavefront_api_client.ApiClient(symphony_config))
except Exception as e:
    symphony_api_instance = None

# Metrices for whom we take only top K candidates. 20 in this case
lst = ["Program time", "Denorm Latency By Object Type", "Input SDM", "Object Churn"]


# Priority of metrics. High priority metric breaches will
# be highlighted first
class Priority(Enum):
Esempio n. 6
0
def get_api_instance(client):
    # Returns Wavefront API's QueryAPI object
    return wave_api.QueryApi(client)