aboutsummaryrefslogtreecommitdiffstats
path: root/examples/compute-qpi-report/report.ipynb
blob: b4068a3797a18cd743bde1fac9e6335316bcadde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAD9CAYAAAC/fMwDAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFuZJREFUeJzt3X3YXHV95/H310SsIA9qYmuTQKjGShYtQopVoVLxIWAL\nfcAWKqv2cqF2xfUBuwV1qbK6Bd3VquBWikprlSfbahaiaHlYkQqSQHgINBgwSBAlIqjoAoZ+94/f\nb8xhuO+55557wh34vV/XdV+ZOXPmnO9855zP/ObMzElkJpKkx77HzXYBkqRHhoEvSY0w8CWpEQa+\nJDXCwJekRhj4ktQIA1+SGmHgS1IjDHxJasTc2VrxvHnzcvHixbO1ekl6VFq9evX3M3P+KPedtcBf\nvHgxq1atmq3VS9KjUkTcOup9PaQjSY0w8CWpEQa+JDXCwJekRhj4ktQIA1+SGmHgS1IjDHxJaoSB\nL0mNmLVf2uqRt/i482d1/RtOeuWsrl9qnSN8SWrEo3KEvy2PVLfl2iS1zRG+JDXCwJekRhj4ktQI\nA1+SGmHgS1IjDHxJaoSBL0mNMPAlqREGviQ1wsCXpEYY+JLUiEfluXT02OM5iKStzxG+JDXCwJek\nRhj4ktQIA1+SGmHgS1Ij/JaO9Cjmt5s0HY7wJakRQwV+RCyPiHURsT4ijpvg9l0j4uKIuDoiro2I\ng8dfqiRpJqYM/IiYA5wKHAQsBY6IiKV9s70LOCcznwccDnxs3IVKkmZmmBH+vsD6zLw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     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "from asq.initiators import query\n",
    "import json\n",
    "\n",
    "workload_name = []\n",
    "workload_score = []\n",
    "project_name = 'workspace'\n",
    "\n",
    "with open(\"qpi.json\".format(project_name)) as result:\n",
    "    final = json.load(result)\n",
    "\n",
    "qpi = query(final['nodes']).where(lambda child: child['name'] == 'node-9') \\\n",
    "        .select_many(lambda child: child['sections']) \\\n",
    "        .where(lambda child: child['name'] == 'SSL') \\\n",
    "        .select_many(lambda child: child['metrics']).to_list()\n",
    "\n",
    "for wl in qpi[0]['workloads']:\n",
    "    workload_name.append(wl['name'])\n",
    "    workload_score.append(wl['score'])\n",
    "\n",
    "x_axis = range(len(workload_name))\n",
    "\n",
    "plt.bar(x_axis, workload_score)\n",
    "plt.xticks(x_axis, workload_name)\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}