Permalink
Browse files

distinguish python run from python sql run

  • Loading branch information...
1 parent 55113f3 commit 5bfd854cd6eaeb383a418c11b3fa12d6234864ed @bcui6611 committed Apr 13, 2012
Showing with 8 additions and 2 deletions.
  1. +6 −0 analyzer.py
  2. +2 −2 cluster_stats.py
View
@@ -16,6 +16,9 @@ def run_analysis(self):
if counter['type'] == 'SQL':
result = self.accessor.execute(counter['code'])
print counter["description"], ":", result[0]
+ elif counter['type'] == 'pythonSQL':
+ result = eval("cluster_stats.{0}().run(self.accessor)".format(counter['code']))
+ print counter["description"], ": ", result
elif counter['type'] == 'python':
result = eval("cluster_stats.{0}().run(counter)".format(counter['code']))
print counter["description"], ": ", result
@@ -25,6 +28,9 @@ def run_analysis(self):
if counter['type'] == 'SQL':
result = self.accessor.execute(counter['code'])
print counter["description"], ":", result[0]
+ elif counter['type'] == 'pythonSQL':
+ result = eval("cluster_stats.{0}().run(self.accessor)".format(counter['code']))
+ print counter["description"], ": ", result
elif counter['type'] == 'python':
result = eval("diskqueue_stats.{0}().run(counter)".format(counter['code']))
print counter["description"], ": ", result
View
@@ -121,7 +121,7 @@ def run(self, accessor):
"ingredients" : [
{
"description" : "DGM Ratio",
- "type" : "SQL",
+ "type" : "pythonSQL",
"code" : "DGMRatio"
},
]
@@ -130,7 +130,7 @@ def run(self, accessor):
"ingredients" : [
{
"description" : " A/R Ratio",
- "type" : "python",
+ "type" : "pythonSQL",
"code" : "ARRatio"
},
]

0 comments on commit 5bfd854

Please sign in to comment.