Skip to content

Instantly share code, notes, and snippets.

@cdisomma1
Created August 22, 2017 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cdisomma1/76b565d645a5b401c4b344076f19b9db to your computer and use it in GitHub Desktop.
Save cdisomma1/76b565d645a5b401c4b344076f19b9db to your computer and use it in GitHub Desktop.
Linux Memory Leaks
import netuitive
import time
import os
from pympler import tracker
tr = tracker.SummaryTracker()
ApiClient = netuitive.Client(url=os.environ.get('API_URL'), api_key=os.environ.get('CUSTOM_API_KEY'))
MyElement = netuitive.Element()
counter = 0
while True:
timestamp = int(time.mktime(time.localtime()))
MyElement.add_sample('app.error-' + str(counter), timestamp, 1, host='appserver01')
ApiClient.post(MyElement)
MyElement.clear_samples()
tr.print_diff()
counter += 1
Raw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment