Skip to content

Instantly share code, notes, and snippets.

@codemation
Created July 6, 2021 12:21
Show Gist options
  • Save codemation/3ae4f803cb3e32126ce1eba064eb2771 to your computer and use it in GitHub Desktop.
Save codemation/3ae4f803cb3e32126ce1eba064eb2771 to your computer and use it in GitHub Desktop.
Chart Creation
# set initial sync time
time_now=datetime.datetime.now().isoformat()[11:19]
await server.charts.create_dataset(
'cpu',
labels=[time_now],
dataset=[psutil.cpu_percent()]
)
await server.charts.create_dataset(
'mem',
labels=[time_now],
dataset=[psutil.virtual_memory().percent]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment