Skip to content

Commit 5db0075

Browse files
committed
Use black for formatting
1 parent 5ac792c commit 5db0075

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

example.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,32 @@
99
async def main():
1010
"""Get the data from a Netdata instance."""
1111
with aiohttp.ClientSession() as session:
12-
data = Netdata('localhost', loop, session, data='data')
13-
await data.get_data('system.cpu')
12+
data = Netdata("localhost", loop, session, data="data")
13+
await data.get_data("system.cpu")
1414

1515
print(json.dumps(data.values, indent=4, sort_keys=True))
1616

1717
# Print the current value of the system's CPU
18-
print("CPU System:", round(data.values['system'], 2))
18+
print("CPU System:", round(data.values["system"], 2))
1919

2020
with aiohttp.ClientSession() as session:
21-
data = Netdata('localhost', loop, session, data='alarms')
21+
data = Netdata("localhost", loop, session, data="alarms")
2222
await data.get_alarms()
2323

2424
print(data.alarms)
2525

2626
with aiohttp.ClientSession() as session:
27-
data = Netdata('localhost', loop, session)
27+
data = Netdata("localhost", loop, session)
2828
await data.get_allmetrics()
2929

3030
print(data.metrics)
3131

3232
# Print the current value for the system's CPU
33-
print("CPU System:", round(data.metrics['system.cpu']
34-
['dimensions']['system']['value'], 2))
33+
print(
34+
"CPU System:",
35+
round(data.metrics["system.cpu"]["dimensions"]["system"]["value"], 2),
36+
)
37+
3538

3639
loop = asyncio.get_event_loop()
3740
loop.run_until_complete(main())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy