You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
smart-top/smart/top/__init__.py

129 lines
4.6 KiB
Python

"""
This file contains class and functions that extract data from running processes like top and stores them into a data store of the calling codes choice
dependencies:
- top (on the os)
@TODO:
Test this thing on windows to see if it works
"""
import pandas as pd
import numpy as np
import subprocess
import os
import datetime
# from transport import factory
import sys
import hashlib
if rows.index(item) != 0 :
df.columns =['pid','user','mem','cpu','status','started','name','cmd','args','date','time','node']
#
# We should filter the name of the apps we are interested in here (returning the full logs )
# @TODO: Add filter here to handle filter on different columns
#
if 'name' in args :
names = args['name'].split(',')
r = pd.DataFrame()
for name in names :
tmp = df[df.name == name.strip()]