Adding graph_csv.py script#5
Adding graph_csv.py script#5Guilhermeslucas wants to merge 18 commits intoUnicamp-OpenPower:masterfrom
Conversation
|
Just added some more modifications, fixing the problem of no feedback about measuring while storing data on db. Fixing #4 . |
graph_csv.py
Outdated
|
|
||
| INTERVAL = 10 | ||
|
|
||
| #function used to build the ipmi and csv commands |
There was a problem hiding this comment.
functions comments are located between """comment""
def func()
"""my comment"""
| Run ```csvcreator.py``` like this: | ||
|
|
||
| ``` | ||
| python2.7 csvcreator.py --jsonfile="generated_json_name" |
There was a problem hiding this comment.
we can remove python 2.7 from the command specification. Given we added it at the top of file. In addition, ensure you chmod +x you Python script before pushing it.
graph_csv.py
Outdated
|
|
||
| return ipmi_command,csv_command | ||
|
|
||
| #function to get the arguments from the user |
There was a problem hiding this comment.
functions comments are located between """comment""
def func()
"""my comment"""
graph_csv.py
Outdated
| def build_commands(args): | ||
| year = time.strftime("%Y") | ||
| month = int(time.strftime("%m")) | ||
| # DO NOT FORGET TO CHANGE THIS AFTER TESTING |
graph_csv.py
Outdated
| day = int(time.strftime("%d")) + 1 | ||
| date=str(year)+str(month)+str(day) | ||
|
|
||
| csv_command = 'python2.7 csvcreator.py --name=last --date='+date+' --jsonfile=' |
There was a problem hiding this comment.
As some people use python as an alias for python3, I think that's not a good idea.
graph_csv.py
Outdated
| help='jsonfile to be converted as csv') | ||
| return parser.parse_args() | ||
|
|
||
| #function to run the collection of data |
There was a problem hiding this comment.
functions comments are located between """comment""
def func()
"""my comment"""
graph_csv.py
Outdated
| def run_collector(command): | ||
| os.system(command) | ||
|
|
||
| #function to run the csv generator |
There was a problem hiding this comment.
functions comments are located between """comment""
def func()
"""my comment"""
graph_csv.py
Outdated
| #function to run the csv generator | ||
| def run_csv(command): | ||
| while 1: | ||
| time.sleep(300) |
There was a problem hiding this comment.
shouldn't this value be defined by user?
There was a problem hiding this comment.
Nice idea. Just did it!
graph_csv.py
Outdated
| while 1: | ||
| time.sleep(300) | ||
| os.system(command) | ||
| os.system("tail -n 300 last.csv > aux.csv") |
There was a problem hiding this comment.
shouldn't we verify for the file availability?
There was a problem hiding this comment.
Do you think it's necessary? Line 85 is in charge of creating it.
| INFINITY = False | ||
| STORE = False | ||
|
|
||
| FEEDBACK = False |
There was a problem hiding this comment.
I suggest to split the patch in two: one for the run-all-patch and another for this one. Also, ensure you run pylint on all files.
There was a problem hiding this comment.
Sorry. but I didn't undestand waht you mean.
|
It is failing when you set empty input. We must identify any missing argument and raise a notification. 09:38:15 | Thu May 25 |
This is very simple script that runs both powergraph.py and csv_creator.py at the same time, making csv files with the latest measures.