Exemple #1
0
async def test_metrics_definitions():
    client = MetricsQueryClient(_credential())

    async with client:
        response = client.list_metric_definitions(os.environ['METRICS_RESOURCE_URI'], namespace='microsoft.eventgrid/topics')

        assert response is not None
Exemple #2
0
    async def list_definitions(self):
        credential = DefaultAzureCredential()

        client = MetricsQueryClient(credential)

        metrics_uri = os.environ['METRICS_RESOURCE_URI']
        async with client:
            response = client.list_metric_definitions(metrics_uri)

            async for item in response:
                print(item.namespace)
                for availability in item.metric_availabilities:
                    print(availability.granularity)
Exemple #3
0
async def list_namespaces():
    credential = ClientSecretCredential(
        client_id=os.environ['AZURE_CLIENT_ID'],
        client_secret=os.environ['AZURE_CLIENT_SECRET'],
        tenant_id=os.environ['AZURE_TENANT_ID'])

    client = MetricsQueryClient(credential)

    metrics_uri = os.environ['METRICS_RESOURCE_URI']
    response = client.list_metric_definitions(metrics_uri)

    async for item in response:
        print(item)
        for availability in item.metric_availabilities:
            print(availability.time_grain)