In [1]:
# connect to Oracle using cx_Oracle, open a cursor, run a query and fetch the results
import cx_Oracle
ora_conn = cx_Oracle.connect('scott/tiger@dbserver:1521/orcl.mydomain.com')
cursor = ora_conn.cursor()
cursor.execute('select ename, sal from emp')
res = cursor.fetchall()
cursor.close()
print res
[('FORD', 3000), ('TURNER', 1500), ('BLAKE', 2850), ('MARTIN', 1250), ('SCOTT', 3000), ('JONES', 2975), ('SMITH', 800), ('KING', 5000), ('WARD', 1250), ('MILLER', 1300), ('ALLEN', 1600), ('JAMES', 950), ('CLARK', 2450), ('ADAMS', 1100)]
In [2]:
import pandas as pd
# query Oracle using ora_conn and put the result into a pandas Dataframe
df_ora = pd.read_sql('select * from emp', con=ora_conn)
df_ora
Out[2]:
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
0
7902
FORD
ANALYST
7566.0
1981-12-03
3000
NaN
20
1
7844
TURNER
SALESMAN
7698.0
1981-09-08
1500
0.0
30
2
7698
BLAKE
MANAGER
7839.0
1981-05-01
2850
NaN
30
3
7654
MARTIN
SALESMAN
7698.0
1981-09-28
1250
1400.0
30
4
7788
SCOTT
ANALYST
7566.0
1987-04-19
3000
NaN
20
5
7566
JONES
MANAGER
7839.0
1981-04-02
2975
NaN
20
6
7369
SMITH
CLERK
7902.0
1980-12-17
800
NaN
20
7
7839
KING
PRESIDENT
NaN
1981-11-17
5000
NaN
10
8
7521
WARD
SALESMAN
7698.0
1981-02-22
1250
500.0
30
9
7934
MILLER
CLERK
7782.0
1982-01-23
1300
NaN
10
10
7499
ALLEN
SALESMAN
7698.0
1981-02-20
1600
300.0
30
11
7900
JAMES
CLERK
7698.0
1981-12-03
950
NaN
30
12
7782
CLARK
MANAGER
7839.0
1981-06-09
2450
NaN
10
13
7876
ADAMS
CLERK
7788.0
1987-05-23
1100
NaN
20
In [3]:
df_ora = pd.read_sql('select * from emp where empno=:myempno', params={"myempno":7839},
con=ora_conn)
df_ora
Out[3]:
EMPNO
ENAME
JOB
MGR
HIREDATE
SAL
COMM
DEPTNO
0
7839
KING
PRESIDENT
None
1981-11-17
5000
None
10
In [4]:
# initialize the graphics environment for matplotlib
%matplotlib inline
import matplotlib
matplotlib.style.use('ggplot')
In [5]:
df_ora = pd.read_sql('select ename "Name", sal "Salary" from emp', con=ora_conn)
ora_conn.close()
In [6]:
df_ora.plot(x='Name', y='Salary', title='Salary details, from Oracle demo table',
figsize=(10, 6), kind='bar', color='blue')
Out[6]:
<matplotlib.axes._subplots.AxesSubplot at 0x7fecb3381a50>
In [7]:
ora_conn = cx_Oracle.connect('system/manager@dbserver:1521/orcl.mydomain.com')
df_ora = pd.read_sql('''
select cast(min(sn.begin_interval_time) over (partition by sn.dbid,sn.snap_id) as date) snap_time,
sn.instance_number,
ss.metric_name||' - '||ss.metric_unit metric_name_unit,
ss.maxval,
ss.average
from dba_hist_sysmetric_summary ss,
dba_hist_snapshot sn
where
sn.snap_id = ss.snap_id
and sn.dbid = ss.dbid
and sn.instance_number = ss.instance_number
and sn.begin_interval_time between trunc(sysdate-2) and trunc(sysdate)
order by sn.snap_id''', con=ora_conn)
ora_conn.close()
In [8]:
mydata=df_ora[(df_ora['METRIC_NAME_UNIT']=='Average Active Sessions - Active Sessions') &
(df_ora['INSTANCE_NUMBER']==1)][['SNAP_TIME','AVERAGE']]
mydata.columns=['Snapshot time','Average N# active sessions']
mydata
Out[8]:
Snapshot time
Average N# active sessions
259
2016-06-04 00:00:10
3.920560
902
2016-06-04 00:30:17
3.707861
1519
2016-06-04 01:00:04
2.855422
2185
2016-06-04 01:30:05
2.227370
2831
2016-06-04 02:00:12
2.152043
3535
2016-06-04 02:30:15
2.131511
4133
2016-06-04 03:00:22
2.018975
4706
2016-06-04 03:30:29
2.009894
5317
2016-06-04 04:00:01
2.822917
5993
2016-06-04 04:30:07
4.023914
6593
2016-06-04 05:00:17
1.870056
7244
2016-06-04 05:30:03
2.047915
7887
2016-06-04 06:00:10
1.771566
8527
2016-06-04 06:30:14
2.138115
9099
2016-06-04 07:00:18
1.940014
9757
2016-06-04 07:30:25
2.223435
10364
2016-06-04 08:00:01
2.915000
10996
2016-06-04 08:30:09
3.200985
11651
2016-06-04 09:00:19
3.156595
12277
2016-06-04 09:30:06
3.237668
12919
2016-06-04 10:00:13
2.934591
13525
2016-06-04 10:30:21
3.115289
14157
2016-06-04 11:00:01
3.081968
14949
2016-06-04 11:30:06
10.115706
15455
2016-06-04 12:00:01
2.953109
16057
2016-06-04 12:30:06
2.176632
16715
2016-06-04 13:00:11
1.817830
17323
2016-06-04 13:30:19
2.219040
17887
2016-06-04 14:00:24
1.802805
18577
2016-06-04 14:30:32
2.416435
...
...
...
42071
2016-06-05 09:00:04
3.404665
42703
2016-06-05 09:30:01
4.374614
43335
2016-06-05 10:00:13
3.245444
43967
2016-06-05 10:30:03
4.842100
44599
2016-06-05 11:00:08
1.982747
45231
2016-06-05 11:30:10
2.144027
45863
2016-06-05 12:00:18
1.863776
46495
2016-06-05 12:30:26
1.899092
47127
2016-06-05 13:00:00
2.812630
47759
2016-06-05 13:30:00
3.277050
48391
2016-06-05 14:00:03
4.312032
49023
2016-06-05 14:30:14
2.036343
49655
2016-06-05 15:00:21
1.911278
50287
2016-06-05 15:30:28
1.817470
50919
2016-06-05 16:00:08
1.589477
51551
2016-06-05 16:30:15
2.065947
52183
2016-06-05 17:00:01
1.675464
52815
2016-06-05 17:30:03
1.989072
53447
2016-06-05 18:00:06
1.855867
54079
2016-06-05 18:30:12
1.998102
54711
2016-06-05 19:00:20
1.664484
55343
2016-06-05 19:30:21
1.940359
55975
2016-06-05 20:00:31
1.641701
56607
2016-06-05 20:30:38
2.334493
57239
2016-06-05 21:00:04
1.961026
57871
2016-06-05 21:30:02
2.049869
58503
2016-06-05 22:00:07
1.708898
59135
2016-06-05 22:30:16
2.065450
59767
2016-06-05 23:00:24
1.725731
60399
2016-06-05 23:30:34
2.183524
96 rows × 2 columns
In [9]:
%matplotlib inline
import matplotlib.pyplot as plt
import matplotlib.dates as md
plt.style.use('ggplot')
In [10]:
ax = mydata.plot(x='Snapshot time', y='Average N# active sessions',
linewidth=3, style='ro-', figsize=(18, 6),
title='From Oracle AWR: average number of active sessions for instance N.1')
xfmt = md.DateFormatter('%Y-%m-%d %H:%M')
ax.xaxis.set_major_formatter(xfmt)
ax.set_ylabel('Number of active sessions')
Out[10]:
<matplotlib.text.Text at 0x7fecb0804f10>
In [11]:
my_pivot=df_ora.pivot_table(index="SNAP_TIME", columns="METRIC_NAME_UNIT", aggfunc=sum, values="AVERAGE")
my_pivot
Out[11]:
METRIC_NAME_UNIT
Active Parallel Sessions - Sessions
Active Serial Sessions - Sessions
Average Active Sessions - Active Sessions
Average Synchronous Single-Block Read Latency - Milliseconds
Background CPU Usage Per Sec - CentiSeconds Per Second
Background Checkpoints Per Sec - Check Points Per Second
Background Time Per Sec - Active Sessions
Branch Node Splits Per Sec - Splits Per Second
Branch Node Splits Per Txn - Splits Per Txn
Buffer Cache Hit Ratio - % (LogRead - PhyRead)/LogRead
...
User Calls Ratio - % UserCalls/AllCalls
User Commits Per Sec - Commits Per Second
User Commits Percentage - % (UserCommit/TotalUserTxn)
User Limit % - % Sessions/License_Limit
User Rollback Undo Records Applied Per Txn - Records Per Txn
User Rollback UndoRec Applied Per Sec - Records Per Second
User Rollbacks Per Sec - Rollbacks Per Second
User Rollbacks Percentage - % (UserRollback/TotalUserTxn)
User Transaction Per Sec - Transactions Per Second
Workload Capture and Replay status - status
SNAP_TIME
2016-06-04 00:00:10
0.200000
30.133333
22.029518
111.506866
242.588983
0.003889
3.723117
0.224473
0.001329
397.349434
...
279.103876
905.370422
395.138030
0.000033
7.665098
3625.375920
5.665756
4.861970
911.036177
0.0
2016-06-04 00:30:17
0.033333
23.466667
17.255362
117.181601
157.808957
0.003323
1.908710
0.299461
0.003180
389.629693
...
285.838168
1014.622589
396.392062
0.000036
0.090494
22.413794
5.455471
3.607938
1020.078060
0.0
2016-06-04 01:00:04
0.100000
22.833333
15.592799
186.665864
149.204332
0.002790
1.872055
0.237342
0.001077
399.790348
...
283.738210
961.149508
394.891787
0.000035
0.136168
42.993456
6.039411
5.108213
967.188918
0.0
2016-06-04 01:30:05
0.200000
29.300000
18.818992
129.780716
154.993868
0.003335
1.815822
0.308189
0.000966
399.843517
...
282.684440
1121.274806
392.039774
0.000036
0.057145
21.307433
8.031768
7.960226
1129.306573
0.0
2016-06-04 02:00:12
0.133333
27.733333
20.950676
381.086351
186.136682
0.003898
2.401716
0.219868
0.000906
399.781621
...
278.407817
1113.572113
392.981897
0.000037
0.105903
51.171744
6.441019
7.018103
1120.013132
0.0
2016-06-04 02:30:15
0.466667
25.100000
15.606730
124.422607
156.784178
0.003323
1.894843
0.236719
0.000669
399.919298
...
280.215017
1173.521231
394.954972
0.000037
0.055846
26.324725
5.472090
5.045028
1178.993321
0.0
2016-06-04 03:00:22
0.433333
27.125806
20.837934
220.009492
164.058485
0.003308
2.038079
0.246270
0.000861
399.922377
...
285.289217
1103.210949
395.511516
0.000037
0.067660
26.956894
6.073276
4.488484
1109.284225
0.0
2016-06-04 03:30:29
0.200000
23.650575
18.126186
193.933580
140.621508
0.003392
1.683948
0.186295
0.000675
399.929673
...
287.178937
1063.146494
396.464817
0.000037
0.063940
26.376526
5.372848
3.535183
1068.519341
0.0
2016-06-04 04:00:01
0.066667
24.288172
17.437579
144.973160
227.435097
0.002754
3.364817
0.299046
0.001095
395.275500
...
284.744470
1084.686930
396.211321
0.000037
0.137551
60.508421
7.038891
3.788679
1091.725821
0.0
2016-06-04 04:30:07
0.133333
24.333333
19.882934
140.884942
190.556946
0.005016
2.278168
0.278925
0.000861
397.339902
...
288.567733
1137.573540
397.143679
0.000038
0.093604
37.520398
5.724759
2.856321
1143.298299
0.0
2016-06-04 05:00:17
0.133333
24.409195
17.025932
158.559820
174.048651
0.001682
2.196499
0.229719
0.000834
399.940320
...
287.097109
1075.134246
396.594030
0.000038
0.088427
34.519434
5.868209
3.405970
1081.002456
0.0
2016-06-04 05:30:03
0.000000
21.550538
15.085801
188.242192
148.067329
0.003318
1.865613
0.235205
0.000878
399.926565
...
287.420120
1044.865705
396.514750
0.000038
0.058992
21.985207
5.765516
3.485250
1050.631221
0.0
2016-06-04 06:00:10
0.000000
21.766667
16.749590
147.136937
173.758439
0.002771
2.085174
0.228757
0.000992
399.909231
...
280.091833
976.471472
394.913714
0.000039
0.066175
23.905419
5.864890
5.086286
982.336362
0.0
2016-06-04 06:30:14
0.000000
19.866667
15.759686
114.624001
156.711052
0.003898
1.831544
0.199302
0.000738
399.918550
...
282.766384
992.408376
395.978333
0.000038
0.086473
30.094983
5.434635
4.021667
997.843011
0.0
2016-06-04 07:00:18
0.000000
20.233333
14.856249
228.154108
178.390072
0.002790
2.164997
0.207670
0.000936
399.926366
...
280.831818
867.042356
395.227145
0.000037
0.096741
29.160938
5.301298
4.772855
872.343654
0.0
2016-06-04 07:30:25
0.000000
22.590805
15.258649
157.362447
151.013401
0.003373
1.781129
0.203167
0.000913
399.938224
...
282.701855
930.362911
395.297503
0.000038
0.100387
37.218459
5.502051
4.702497
935.864962
0.0
2016-06-04 08:00:01
0.000000
19.789247
16.436835
104.197146
196.607091
0.002191
2.310705
0.201388
0.000861
393.742239
...
278.705703
936.128949
394.916742
0.000038
0.085245
30.102032
5.670969
5.083258
941.799918
0.0
2016-06-04 08:30:09
0.000000
24.666667
18.010500
93.585595
193.223999
0.003325
2.340802
0.262746
0.000917
399.511320
...
287.715797
1060.765304
396.001339
0.000040
0.095493
37.138094
6.576147
3.998661
1067.341451
0.0
2016-06-04 09:00:19
0.266667
28.600000
19.855157
123.380040
236.084524
0.002790
3.054523
0.216213
0.000896
399.767216
...
279.332915
936.768602
395.801771
0.000038
0.090826
29.936204
5.597414
4.198229
942.366015
0.0
2016-06-04 09:30:06
0.000000
22.700000
17.728371
134.608104
208.958043
0.003880
2.569587
0.178840
0.000750
399.601580
...
281.241464
952.056478
395.864590
0.000038
0.081664
29.878660
5.407061
4.135410
957.463539
0.0
2016-06-04 10:00:13
0.133333
23.300000
17.470202
298.876793
183.410113
0.002217
2.320008
0.216170
0.000942
399.455742
...
277.742697
903.657459
394.429512
0.000038
0.279166
115.267569
6.055961
5.570488
909.713421
0.0
2016-06-04 10:30:21
0.000000
21.300000
16.556629
140.057553
164.115243
0.004490
1.987481
0.183848
0.000826
398.622302
...
282.897590
962.648731
395.470513
0.000038
0.099360
35.752601
5.375204
4.529487
968.023935
0.0
2016-06-04 11:00:01
0.033333
23.066667
16.699302
118.819505
180.912075
0.001672
2.184064
0.192755
0.000946
396.641472
...
277.045523
911.581387
394.267556
0.000041
0.139545
61.148305
5.727302
5.732444
917.308688
0.0
2016-06-04 11:30:06
0.000000
22.900000
24.963356
92.962759
178.093403
0.003344
2.079898
0.238742
0.000911
397.237153
...
279.020976
948.745019
392.410987
0.000040
0.136226
53.412411
7.590846
7.589013
956.335865
0.0
2016-06-04 12:00:01
0.133333
23.333333
17.570883
101.373606
193.121844
0.002771
2.393035
0.261118
0.001095
396.024627
...
278.118225
964.723856
393.877351
0.000038
0.106513
33.411639
7.324147
6.122649
972.048004
0.0
2016-06-04 12:30:06
0.100000
22.692473
15.268431
103.901241
154.740292
0.003290
1.842904
0.224494
0.000892
399.911760
...
281.668430
963.386016
395.190744
0.000039
0.079148
23.290067
5.163798
4.809256
968.549813
0.0
2016-06-04 13:00:11
0.133333
19.966667
14.398105
157.810275
166.232138
0.002781
2.004867
0.195139
0.000903
399.908232
...
280.126005
843.621562
394.371787
0.000039
0.177385
59.322072
6.091714
5.628213
849.713276
0.0
2016-06-04 13:30:19
0.000000
26.466667
16.479015
93.457725
166.724700
0.003325
1.934881
0.239923
0.000963
399.939269
...
287.334066
962.415051
395.856187
0.000040
0.090050
30.692254
6.920400
4.143813
969.335451
0.0
2016-06-04 14:00:24
0.000000
23.466667
14.654901
225.659677
171.394908
0.002779
2.064870
0.177077
0.000781
399.908202
...
276.410540
883.207327
394.686336
0.000039
0.071436
23.634357
5.920189
5.313664
889.127517
0.0
2016-06-04 14:30:32
0.000000
25.868966
14.492023
278.645062
155.391397
0.003373
2.038239
0.194918
0.000800
399.860939
...
284.400774
890.977665
395.043885
0.000039
0.109428
32.406170
6.296589
4.956115
897.274254
0.0
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
2016-06-05 09:00:04
0.400000
38.166667
30.232009
94.773227
247.976477
0.003335
3.538104
0.242315
0.000848
398.336749
...
285.867130
1073.222355
395.788013
0.000039
0.060739
23.456587
7.278776
4.211987
1080.501131
0.0
2016-06-05 09:30:01
0.133333
35.633333
23.809177
201.899240
215.217844
0.003333
2.901688
0.221661
0.000843
395.047811
...
285.913952
1010.994955
396.604988
0.000039
0.079811
29.167099
6.555052
3.395012
1017.550007
0.0
2016-06-05 10:00:13
0.066667
24.866667
16.625170
114.542078
194.402866
0.002780
2.485770
0.216209
0.001025
397.822149
...
286.754275
939.301875
395.316269
0.000039
0.087308
26.477670
5.858064
4.683731
945.159939
0.0
2016-06-05 10:30:03
0.000000
22.766667
18.486605
135.905140
175.732493
0.003880
2.164236
0.193785
0.000855
399.757380
...
289.254637
976.000635
395.717731
0.000040
0.082137
25.141723
5.379561
4.282269
981.380196
0.0
2016-06-05 11:00:08
0.000000
22.633333
14.063914
139.134638
174.986579
0.002217
2.152488
0.243431
0.001011
399.891172
...
290.335958
969.955352
394.204335
0.000040
0.139955
55.400267
8.936312
5.795665
978.891665
0.0
2016-06-05 11:30:10
0.133333
19.466667
16.246151
98.007902
168.811123
0.003889
1.987494
0.210112
0.000887
399.766800
...
286.079640
865.867588
395.993123
0.000041
0.097915
29.375934
5.974071
4.006877
871.841659
0.0
2016-06-05 12:00:18
0.000000
21.726882
15.462986
192.466757
168.800356
0.002736
2.049810
0.189965
0.001019
399.901790
...
284.679271
890.062815
395.519587
0.000039
0.086285
29.169542
5.964896
4.480413
896.027711
0.0
2016-06-05 12:30:26
0.034483
17.456322
13.759161
214.995856
152.370732
0.003364
1.818538
0.214408
0.000784
399.902445
...
284.422482
940.512955
393.994242
0.000040
0.067346
23.635998
8.765669
6.005758
949.278624
0.0
2016-06-05 13:00:00
0.000000
19.100000
14.709919
208.909654
174.600406
0.002236
2.223491
0.187305
0.000803
394.083397
...
286.378672
833.237314
394.827246
0.000038
0.171958
52.247820
6.777111
5.172754
840.014425
0.0
2016-06-05 13:30:00
0.066667
21.966667
17.034267
130.614089
185.757245
0.003880
2.179629
0.226006
0.000918
392.755460
...
289.119311
929.722730
395.606214
0.000040
0.142011
39.376797
6.871603
4.393786
936.594333
0.0
2016-06-05 14:00:03
0.133333
20.266667
15.778462
171.032633
175.503460
0.002777
2.137402
0.203446
0.000889
398.906086
...
284.085337
879.265961
395.145314
0.000038
0.154465
44.937129
6.017187
4.854686
885.283148
0.0
2016-06-05 14:30:14
0.066667
20.033333
12.992450
138.273396
147.826275
0.003325
2.012140
0.199416
0.000917
399.908531
...
286.667176
897.805382
392.004795
0.000040
0.061624
17.919518
8.442936
7.995205
906.248317
0.0
2016-06-05 15:00:21
0.100000
20.624731
13.034236
112.929688
154.185780
0.002736
2.841717
0.216908
0.000959
399.905611
...
287.879433
889.033535
394.092507
0.000040
0.104761
37.204332
6.946444
5.907493
895.979979
0.0
2016-06-05 15:30:28
0.066667
20.819540
13.491658
173.216383
135.772628
0.003373
2.579118
0.183385
0.000640
399.906155
...
285.684710
916.171166
395.142105
0.000041
0.084629
27.385921
6.674196
4.857895
922.845362
0.0
2016-06-05 16:00:08
0.100000
19.066667
13.280451
213.879077
159.384379
0.002790
3.038858
0.224943
0.001077
399.882235
...
288.372052
864.479737
394.707045
0.000041
0.106124
33.353440
6.624431
5.292955
871.104168
0.0
2016-06-05 16:30:15
0.066667
21.600000
15.737706
168.221493
146.777805
0.003325
2.699174
0.170056
0.000770
399.916350
...
288.271339
887.256681
396.339104
0.000040
0.073052
20.843069
5.305031
3.660896
892.561712
0.0
2016-06-05 17:00:01
0.000000
22.033333
15.276792
148.101161
189.174775
0.002790
3.231374
0.208787
0.000891
394.217003
...
283.067118
897.684173
394.488600
0.000041
0.135365
46.944158
6.363478
5.511400
904.047650
0.0
2016-06-05 17:30:03
0.100000
20.300000
14.338033
140.074114
147.705507
0.003325
2.700209
0.177673
0.000779
393.707989
...
288.167877
917.362867
396.058383
0.000041
0.090716
27.863025
5.334260
3.941617
922.697127
0.0
2016-06-05 18:00:06
0.000000
20.233333
16.335215
115.817147
220.506576
0.005035
4.121525
0.204490
0.000782
397.246530
...
287.070314
951.934827
394.912693
0.000040
0.069002
24.029795
6.667224
5.087307
958.602051
0.0
2016-06-05 18:30:12
0.000000
19.966667
12.521425
204.160083
211.586854
0.003335
3.770247
0.180577
0.000728
399.921831
...
284.124363
874.371534
396.063883
0.000041
0.102137
32.854098
5.384812
3.936117
879.756346
0.0
2016-06-05 19:00:20
0.100000
18.466667
13.198479
161.876804
156.661891
0.002781
2.057245
0.220614
0.000936
399.907018
...
288.804128
846.530081
394.700458
0.000040
0.121500
38.077041
6.876794
5.299542
853.406875
0.0
2016-06-05 19:30:21
0.000000
21.020430
16.024201
131.555183
153.629737
0.003308
1.849807
0.233596
0.000884
399.910154
...
292.708745
976.900409
395.930083
0.000043
0.099349
33.473436
5.465610
4.069917
982.366018
0.0
2016-06-05 20:00:31
0.033333
20.333333
14.846664
77.532558
157.419173
0.003335
2.049240
0.240201
0.001052
399.886432
...
287.706116
897.705924
394.938875
0.000042
0.146397
54.687246
7.003949
5.061125
904.709872
0.0
2016-06-05 20:30:38
0.000000
25.717241
16.786258
63.232203
179.288660
0.003956
2.645206
0.186173
0.000809
399.500221
...
289.093063
957.774783
395.754236
0.000042
0.107473
37.027631
6.559172
4.245764
964.333955
0.0
2016-06-05 21:00:04
0.000000
24.586207
20.219970
183.991388
191.503731
0.003927
2.663436
0.220807
0.000984
399.737704
...
287.673779
1018.534755
394.802712
0.000040
0.140538
56.195555
7.016829
5.197288
1025.551583
0.0
2016-06-05 21:30:02
0.000000
19.745161
16.148528
300.444409
164.664601
0.005480
2.270210
0.708629
0.002461
399.876122
...
286.594479
945.882257
395.444934
0.000041
0.213254
63.310766
6.440500
4.555066
952.322757
0.0
2016-06-05 22:00:07
0.133333
20.633333
17.673491
168.055962
194.017726
0.003335
2.927389
0.436657
0.001511
399.818588
...
286.000326
833.430251
394.480634
0.000041
0.152424
49.084075
5.649339
5.519366
839.079590
0.0
2016-06-05 22:30:16
0.000000
21.400000
15.141145
192.909565
154.510268
0.003879
2.001771
0.223951
0.000908
399.922884
...
292.267537
967.566982
395.139028
0.000041
0.109648
33.800153
8.127797
4.860972
975.694779
0.0
2016-06-05 23:00:24
0.032258
20.661290
16.763545
181.445935
155.903368
0.002752
2.003223
0.185952
0.000955
399.450862
...
286.043804
842.846001
394.656663
0.000041
0.122855
41.810604
6.374041
5.343337
849.220042
0.0
2016-06-05 23:30:34
0.000000
25.366667
16.662107
216.296885
152.880598
0.003325
1.989808
0.215612
0.000829
398.786676
...
289.987739
965.237905
394.891601
0.000040
0.111295
38.143105
8.471379
5.108399
973.709285
0.0
96 rows × 158 columns
In [12]:
fig, axes = plt.subplots(nrows=2, ncols=2, figsize=(18, 18), sharex=True)
axes[0,0].xaxis.set_major_formatter(xfmt)
ax = my_pivot.plot(y='Average Active Sessions - Active Sessions', title='Active sessions',
ax=axes[0,0], linewidth=3, style='ro-').set_ylabel('Number of active sessions')
ax = my_pivot.plot(y='CPU Usage Per Sec - CentiSeconds Per Second', title='CPU usage',
ax=axes[1,0], linewidth=3, style='ro-').set_ylabel('CPU usage (centiseconds / second)')
ax = my_pivot.plot(y='Physical Read Total IO Requests Per Sec - Requests Per Second',
title='I/O operations per second',
ax=axes[0,1], linewidth=3, style='bo-').set_ylabel('IOPS')
ax = my_pivot.plot(y='I/O Megabytes per Second - Megabtyes per Second', title='I/O throughput',
ax=axes[1,1], linewidth=3, style='bo-').set_ylabel('MB/sec')
plt.show()
In [ ]:
Content source: LucaCanali/Miscellaneous
Similar notebooks: