mirror of
https://github.com/justinccdev/opensimulator-tools.git
synced 2026-08-14 01:07:50 +00:00
minor: simplify analysis readme line
This commit is contained in:
@@ -12,8 +12,7 @@ individual READMEs
|
||||
|
||||
## analysis ##
|
||||
|
||||
Tools for analysing OpenSimulator or related data files and for extracting
|
||||
relevant system information.
|
||||
Tools for analysing OpenSimulator or related data files.
|
||||
|
||||
## commands ##
|
||||
|
||||
|
||||
@@ -45,6 +45,17 @@ class OSimStatsCorpus:
|
||||
else:
|
||||
return None
|
||||
|
||||
def getStats(self, glob):
|
||||
matchingStats = []
|
||||
|
||||
for category, containers in self._data.items():
|
||||
for container, stats in containers.items():
|
||||
for statName, stat in stats.items():
|
||||
if fnmatch.fnmatch(stat['fullName'], glob):
|
||||
matchingStats.append(stat)
|
||||
|
||||
return matchingStats
|
||||
|
||||
"""Clear out any existing dataset."""
|
||||
def clear(self):
|
||||
self._data = {}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
import argparse
|
||||
import matplotlib.pyplot as plt
|
||||
import sys
|
||||
from pylab import *
|
||||
from osta.osta import *
|
||||
|
||||
@@ -22,24 +23,30 @@ parser.add_argument(
|
||||
parser.add_argument(
|
||||
'statsLogPath',
|
||||
help = "Path to the stats log file.",
|
||||
metavar = "stats-log-path")
|
||||
metavar = "stats-log-path",
|
||||
nargs='*')
|
||||
|
||||
opts = parser.parse_args()
|
||||
|
||||
corpus = OSimStatsCorpus()
|
||||
corpus.parse(opts.statsLogPath)
|
||||
|
||||
stat = corpus.getStat(opts.select)
|
||||
for path in opts.statsLogPath:
|
||||
corpus.parse(path)
|
||||
|
||||
if not stat == None:
|
||||
plt.plot(stat['abs']['values'])
|
||||
plt.title(stat['fullName'])
|
||||
plt.xlabel("samples")
|
||||
plt.ylabel(stat['name'])
|
||||
stats = corpus.getStats(opts.select)
|
||||
|
||||
if len(stats) <= 0:
|
||||
print "No stats matching %s" % (opts.select)
|
||||
sys.exit(1)
|
||||
|
||||
plt.title(opts.select)
|
||||
plt.ylabel(stats[0]['name'])
|
||||
|
||||
for stat in stats:
|
||||
plt.plot(stat['abs']['values'])
|
||||
plt.xlabel("samples")
|
||||
|
||||
if 'out' in opts:
|
||||
savefig(opts.out)
|
||||
else:
|
||||
plt.show()
|
||||
if 'out' in opts:
|
||||
savefig(opts.out)
|
||||
else:
|
||||
print "No such stat as %s" % (opts.select)
|
||||
plt.show()
|
||||
Reference in New Issue
Block a user