~andrewjbeach/juju-ci-tools/get-juju-dict

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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Latest compiled and minified CSS -->
    <link
       rel="stylesheet"
       href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
       integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7"
       crossorigin="anonymous">

    <!-- Optional theme -->
    <link
       rel="stylesheet"
       href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css"
       integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r"
       crossorigin="anonymous">

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <!-- Latest compiled and minified JavaScript -->
    <script
       src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
       integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
       crossorigin="anonymous"></script>

    <!-- WIP stylings for table collapse. -->
    <style type="text/css" media="screen">
      table.table tr.clickable td:first-child:before {
      content: " \25b2 ";
      font-weight: bold;
      padding-left: 8px;
      padding-right: 8px;
      }
      table.table tr.collapsed td:first-child:before {
      content: " \25bc ";
      font-weight: bold;
      padding-left: 8px;
      padding-right: 8px;
      }
    </style>

    <title>Simple performance/scale reporting</title>

  </head>
  <body role="document">
    <div class="container" role="main">
      <div class="page-header">
        <h1>Performance &amp; Scale testing</h1>
      </div>

      <div class="page-header">
        <h2>Action Timings</h2>
      </div>

      <blockquote>
        <p>
          Breakdown of start and end times of an action (i.e. either
          bootstrapping or deploying a charm).
        </p>
      </blockquote>

      <table class="table">
        <tr>
          <th>Action</th>
          <th>Start</th>
          <th>End</th>
          <th>Duration</th>
        </tr>
        <tr>
          <td>Bootstrap</td>
          <td>{{deployments.bootstrap.start}}</td>
          <td>{{deployments.bootstrap.end}}</td>
          <td>{{deployments.bootstrap.seconds}} Seconds</td>
        </tr>
        {% for deploy in deployments.deploys %}
        <tr>
          <td>Deploy {{deploy.name}}</td>
          <td>{{deploy.timings.start}}</td>
          <td>{{deploy.timings.end}}</td>
          <td>{{deploy.timings.seconds}} Seconds</td>
        </tr>
        <tr>
          <td colspan=4>
            Units
            <ul>
              {% for name in deploy.applications.keys() %}
              <li><b>{{name}}:</b> {{deploy.applications[name]}}</li>
              {% endfor %}
            </ul>
          </td>
        </tr>
        {% endfor %}
        <tr>
          <td>Kill Controller</td>
          <td>{{deployments.cleanup.start}}</td>
          <td>{{deployments.cleanup.end}}</td>
          <td>{{deployments.cleanup.seconds}} Seconds</td>
        </tr>
      </table>

      <div class="page-header">
        <h1>Controller system metrics</h1>
      </div>

      <blockquote>
        <p>
          System metrics are collected on the api-server(s) during the deployment
          of charms. No metrics are collected during the bootstrap process.
        </p>
      </blockquote>

      <h2>CPU Usage</h2>
      <img src="file://{{cpu_graph}}" alt="CPU Usage Graph" />

      <h2>Memory Usage</h2>
      <img src="file://{{memory_graph}}" alt="Memory Usage Graph" />

      <h2>Network Usage</h2>
      <img src="file://{{network_graph}}" alt="Network Usage Graph" />

      <h2>MongoDB Statistics</h2>
      <img src="file://{{mongo_graph}}" alt="MongoDB Details Graph" />

      <div class="page-header">
        <h1>Log Breakdown</h1>
      </div>
      <blockquote>
        <p>
          Logs broken down into 20 second chunks (to match the graphs.)
        </p>
      </blockquote>

      <ul class="nav nav-tabs" role="tablist">
        {% for date_stamp, values in log_message_chunks|dictsort %}
        {% set safe_date_stamp = date_stamp|replace(":", "")|replace(" ", "") %}
        <li
           role="presentation"
           {% if loop.index == 1 %}
           class="active"
           {% endif %}
           >
          <a
             href="#{{safe_date_stamp}}"
             aria-controls="{{safe_date_stamp}}"
             role="tab"
             data-toggle="tab">
            {{values.name}}
          </a>
        </li>
        {% endfor %}
      </ul>

      <div class="tab-content">
        {% for date_stamp, values in log_message_chunks|dictsort %}
        {% set safe_date_stamp = date_stamp|replace(":", "")|replace(" ", "")|replace("(", "")|replace(")", "") %}
        <div
           role="tabpanel"
           class="tab-pane {% if loop.index == 1 %}active{% endif %}"
           id="{{safe_date_stamp}}">
          <h4 class="text-center">Log period: <b>{{date_stamp}}</b></h4>
          <table class="table table-condensed table-bordered">
            {% for log_detail in values.logs|sort(attribute='timeframe') %}
            {% set safe_timeframe = log_detail.timeframe|replace(":", "")|replace(" ", "")|replace("(", "")|replace(")", "") %}
            <tr
               data-toggle="collapse"
               data-target="#{{safe_timeframe}}"
               style="cursor: pointer;"
               class="clickable active collapsed">
              <td>
                {{log_detail.timeframe}}
              </td>
            </tr>
            <tr>
              <td>
                <div id="{{safe_timeframe}}" class="collapse">
                  <small>
                    {{log_detail.message}}
                  </small>
                </div>
              </td>
            </tr>
            {%endfor%}

          </table>
        </div>
        {% endfor %}
      </div>

    </div>
    <footer style="background-color: #f5f5f5; height: 25px; border-top: 1px solid lightgray; padding-left: 12px;">
      Juju Performance/Scale testing
    </footer>
  </body>
</html>