{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Storage QPI Report" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "import json\n", "import pandas as pd\n", "from mpl_toolkits.mplot3d import Axes3D\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "\n", "RESULT_FILE = './storperf-master.json'\n", "with open(RESULT_FILE, 'r') as f:\n", " result_data = json.load(f)\n", "metrics = result_data['report']['metrics']\n", "\n", "# TODO(yujunz) move common functiont to qtip package\n", "\n", "def metrics_to_dataframe(metrics):\n", " \"\"\"convert storperf metrics to DataFrame\"\"\"\n", " def _convert(metric, value):\n", " columns = metric.split('.')\n", " return {\n", " 'workload_name': columns[0],\n", " 'queue_depth': columns[2],\n", " 'block_size': columns[4],\n", " 'read_write': columns[5],\n", " 'metric_name': ('.').join(columns[6:]),\n", " 'value': value\n", " }\n", "\n", " return pd.DataFrame([_convert(*p) for p in metrics.items()])\n", "\n", "def get_metric(metric_name):\n", " return df[df.metric_name == metric_name]\n", "\n", "def plot_metric(metric_name):\n", " df_metric = get_metric(metric_name)\n", " fig = plt.figure()\n", "\n", " ax = fig.add_subplot(111, projection='3d')\n", " for wl, rw, c in zip(['rw', 'rw', 'wr', 'rr'], ['read', 'write', 'write', 'read'], ['r', 'g', 'b', 'y']):\n", " _df = df_metric[(df_metric.workload_name == wl) & (df_metric.read_write == rw)]\n", " ax.scatter(_df.block_size, _df.queue_depth, _df['value'], c=c)\n", "\n", " ax.set_xlabel('block size')\n", " ax.set_ylabel('queue depth')\n", " ax.set_zlabel(metric_name)\n", "\n", "df = metrics_to_dataframe(metrics)\n", "\n", "# filter invalid data\n", "df = df[(df.workload_name != '_warm_up') & (df.value != 0.0)]\n", "df.block_size = df.block_size.astype(int)\n", "df.queue_depth = df.queue_depth.astype(int)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Test Results\n", "\n", "### Bandwidth" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | block_size | \n", "metric_name | \n", "queue_depth | \n", "read_write | \n", "value | \n", "workload_name | \n", "
---|---|---|---|---|---|---|
6 | \n", "16384 | \n", "bw | \n", "1 | \n", "read | \n", "23140.200000 | \n", "rr | \n", "
12 | \n", "2048 | \n", "bw | \n", "1 | \n", "read | \n", "3290.425000 | \n", "rr | \n", "
18 | \n", "16384 | \n", "bw | \n", "4 | \n", "read | \n", "76384.225000 | \n", "rr | \n", "
24 | \n", "2048 | \n", "bw | \n", "4 | \n", "read | \n", "17949.100000 | \n", "rr | \n", "
30 | \n", "16384 | \n", "bw | \n", "1 | \n", "read | \n", "1563.825000 | \n", "rw | \n", "
33 | \n", "16384 | \n", "bw | \n", "1 | \n", "write | \n", "670.450000 | \n", "rw | \n", "
36 | \n", "2048 | \n", "bw | \n", "1 | \n", "read | \n", "202.125000 | \n", "rw | \n", "
39 | \n", "2048 | \n", "bw | \n", "1 | \n", "write | \n", "86.450000 | \n", "rw | \n", "
42 | \n", "16384 | \n", "bw | \n", "4 | \n", "read | \n", "4317.125000 | \n", "rw | \n", "
45 | \n", "16384 | \n", "bw | \n", "4 | \n", "write | \n", "1853.916667 | \n", "rw | \n", "
48 | \n", "2048 | \n", "bw | \n", "4 | \n", "read | \n", "616.812500 | \n", "rw | \n", "
51 | \n", "2048 | \n", "bw | \n", "4 | \n", "write | \n", "264.395833 | \n", "rw | \n", "
57 | \n", "16384 | \n", "bw | \n", "1 | \n", "write | \n", "284.125000 | \n", "wr | \n", "
63 | \n", "2048 | \n", "bw | \n", "1 | \n", "write | \n", "25.800000 | \n", "wr | \n", "
69 | \n", "16384 | \n", "bw | \n", "4 | \n", "write | \n", "507.900000 | \n", "wr | \n", "
75 | \n", "2048 | \n", "bw | \n", "4 | \n", "write | \n", "30.975000 | \n", "wr | \n", "