-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Monitor][Feature]az vm monitor metrics tail: support query metrics f…
…or vm(#11528)
- Loading branch information
1 parent
efab83e
commit 93a50bb
Showing
8 changed files
with
1,711 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/azure-cli/azure/cli/command_modules/vm/tests/latest/_test_util.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -------------------------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for license information. | ||
# -------------------------------------------------------------------------------------------- | ||
|
||
from azure_devtools.scenario_tests import RecordingProcessor | ||
|
||
|
||
class TimeSpanProcessor(RecordingProcessor): | ||
def __init__(self, replacement): | ||
self._replacement = replacement | ||
|
||
def process_request(self, request): | ||
request.uri = self._replace_timespan(request.uri) | ||
|
||
return request | ||
|
||
def _replace_timespan(self, val): | ||
import re | ||
# subscription presents in all api call | ||
retval = re.sub('timespan=((.*?)(&|$))', | ||
r'timespan={}\3'.format(self._replacement), | ||
val, | ||
flags=re.IGNORECASE) | ||
return retval |
Oops, something went wrong.