Skip to content

Commit b5f2b37

Browse files
Update to statistics module. Requires modifications to config file! Added incremental aggregation, independent time resolution from rule def, combined coldefs and more....
git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1514 44740490-163a-0410-bde0-09ae8108e29a
1 parent d63e3ec commit b5f2b37

14 files changed

Lines changed: 1148 additions & 420 deletions

modules/statistics/bin/loganalyzer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@
5353

5454
$aggregator = new sspmod_statistics_Aggregator(TRUE);
5555
$aggregator->dumpConfig();
56+
$aggregator->debugInfo();
5657
$results = $aggregator->aggregate($debug);
58+
$aggregator->debugInfo();
5759

5860
if (!$dryrun) {
5961
$aggregator->store($results);

modules/statistics/config-templates/module_statistics.php

Lines changed: 139 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -47,116 +47,184 @@
4747
* CGI timeout function. Both default to 300 seconds.
4848
*/
4949
'time_limit' => 300,
50+
51+
'time_limit' => 300,
5052

51-
'statrules' => array(
52-
'sso_hoursday' => array(
53-
'name' => 'SSO to service (per 15min)',
54-
'descr' => 'The number of logins at a Service Provider divided into slots of one hour. Each file contains data for one day (24 hours)',
55-
56-
'action' => 'saml20-sp-SSO',
57-
'col' => 6, // Service Provider EntityID
58-
'fieldPresentation' => array(
59-
'class' => 'statistics:Entity',
60-
'config' => 'saml20-sp-remote',
61-
),
53+
'timeres' => array(
54+
'day' => array(
55+
'name' => 'Day',
6256
'slot' => 60*15, // Slots of 15 minutes
6357
'fileslot' => 60*60*24, // One day (24 hours) file slots
6458
'axislabelint' => 6*4, // Number of slots per label. 4 per hour *6 = 6 hours
65-
59+
'dateformat-period' => 'j. M', // 4. Mars
60+
'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30
61+
),
62+
'week' => array(
63+
'name' => 'Week',
64+
'slot' => 60*60, // Slots of one hour
65+
'fileslot' => 60*60*24*7, // 7 days of data in each file
66+
'axislabelint' => 24, // Number of slots per label. 24 is one each day
6667
'dateformat-period' => 'j. M', // 4. Mars
6768
'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30
6869
),
69-
'sso_day80' => array(
70-
'name' => 'SSO to service (per day for 80 days)',
71-
'descr' => 'The number of logins at a Service Provider divided into slots of one day. Each file contains data for 80 days',
70+
'month' => array(
71+
'name' => 'Month',
72+
'slot' => 60*60*24, // Slots of one day
73+
'fileslot' => 60*60*24*30, // 30 days of data in each file
74+
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
75+
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
76+
'dateformat-intra' => 'j. M', // 4. Mars
77+
),
78+
'monthaligned' => array(
79+
'name' => 'AlignedMonth',
80+
'slot' => 60*60*24, // Slots of one day
81+
'fileslot' => NULL, // 30 days of data in each file
82+
'customDateHandler' => 'month',
83+
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
84+
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
85+
'dateformat-intra' => 'j. M', // 4. Mars
86+
),
7287

73-
'action' => 'saml20-sp-SSO',
74-
'col' => 6, // Service Provider EntityID
75-
'fieldPresentation' => array(
76-
'class' => 'statistics:Entity',
77-
'config' => 'saml20-sp-remote',
78-
),
88+
'days180' => array(
89+
'name' => '180 days',
7990
'slot' => 60*60*24, // Slots of 1 day (24 hours)
80-
'fileslot' => 60*60*24*80, // 80 days of data in each file
91+
'fileslot' => 60*60*24*180, // 80 days of data in each file
92+
'axislabelint' => 30, // Number of slots per label. 7 days => 1 week
93+
'dateformat-period' => 'j. M', // 4. Mars
94+
'dateformat-intra' => 'j. M', // 4. Mars
95+
),
96+
),
97+
98+
'time_limit' => 300,
99+
100+
'timeres' => array(
101+
'day' => array(
102+
'name' => 'Day',
103+
'slot' => 60*15, // Slots of 15 minutes
104+
'fileslot' => 60*60*24, // One day (24 hours) file slots
105+
'axislabelint' => 6*4, // Number of slots per label. 4 per hour *6 = 6 hours
106+
'dateformat-period' => 'j. M', // 4. Mars
107+
'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30
108+
),
109+
'week' => array(
110+
'name' => 'Week',
111+
'slot' => 60*60, // Slots of one hour
112+
'fileslot' => 60*60*24*7, // 7 days of data in each file
113+
'axislabelint' => 24, // Number of slots per label. 24 is one each day
114+
'dateformat-period' => 'j. M', // 4. Mars
115+
'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30
116+
),
117+
'month' => array(
118+
'name' => 'Month',
119+
'slot' => 60*60*24, // Slots of one day
120+
'fileslot' => 60*60*24*30, // 30 days of data in each file
81121
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
82-
122+
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
123+
'dateformat-intra' => 'j. M', // 4. Mars
124+
),
125+
'monthaligned' => array(
126+
'name' => 'AlignedMonth',
127+
'slot' => 60*60*24, // Slots of one day
128+
'fileslot' => NULL, // 30 days of data in each file
129+
'customDateHandler' => 'month',
130+
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
131+
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
132+
'dateformat-intra' => 'j. M', // 4. Mars
133+
),
134+
135+
'days180' => array(
136+
'name' => '180 days',
137+
'slot' => 60*60*24, // Slots of 1 day (24 hours)
138+
'fileslot' => 60*60*24*180, // 80 days of data in each file
139+
'axislabelint' => 30, // Number of slots per label. 7 days => 1 week
83140
'dateformat-period' => 'j. M', // 4. Mars
84141
'dateformat-intra' => 'j. M', // 4. Mars
85142
),
86-
'sso_day80realm' => array(
87-
'name' => 'SP by realm (per day for 80 days)',
88-
'descr' => 'The number of logins at a Service Provider divided into slots of one day. Each file contains data for 80 days',
143+
),
144+
'statrules' => array(
145+
'sloratio' => array(
146+
'name' => 'SSO to SLO ratio',
147+
'descr' => 'ratio',
89148

149+
'type' => 'ratio',
150+
90151
'action' => 'saml20-idp-SSO',
91-
'col' => 8, // Service Provider EntityID
152+
'col' => 6, // Service Provider EntityID
92153
'fieldPresentation' => array(
93154
'class' => 'statistics:Entity',
94155
'config' => 'saml20-sp-remote',
95156
),
96-
'slot' => 60*60*24, // Slots of 1 day (24 hours)
97-
'fileslot' => 60*60*24*80, // 80 days of data in each file
98-
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
99-
100-
'graph.total' => TRUE,
101-
102-
103-
'dateformat-period' => 'j. M', // 4. Mars
104-
'dateformat-intra' => 'j. M', // 4. Mars
105157
),
106-
'sso_hoursweek' => array(
107-
'name' => 'SSO to service (per hour for a week)',
108-
'descr' => 'The number of logins at a Service Provider divided into slots of one hour. Each file contains data for one week.',
109-
110-
'action' => 'saml20-sp-SSO',
158+
'sso' => array(
159+
'name' => 'SSO to service',
160+
'descr' => 'The number of logins at a Service Provider.',
161+
'action' => 'saml20-idp-SSO',
111162
'col' => 6, // Service Provider EntityID
112163
'fieldPresentation' => array(
113164
'class' => 'statistics:Entity',
114165
'config' => 'saml20-sp-remote',
115166
),
116-
'slot' => 60*60, // Slots of one hour
117-
'fileslot' => 60*60*24*7, // 7 days of data in each file
118-
'axislabelint' => 24, // Number of slots per label. 24 is one each day
119-
120-
'dateformat-period' => 'j. M', // 4. Mars
121-
'dateformat-intra' => 'j. M H:i', // 4. Mars 12:30
122167
),
123-
'sso_days' => array(
124-
'name' => 'SSO to service (per day for a month)',
125-
'descr' => 'The number of logins at a Service Provider divided into slots of one day. Each file contains data for 30 days.',
126-
127-
'action' => 'saml20-sp-SSO',
168+
'ssofirst' => array(
169+
'name' => 'SSO-first to service',
170+
'descr' => 'The number of logins at a Service Provider.',
171+
'action' => 'saml20-idp-SSO-first',
128172
'col' => 6, // Service Provider EntityID
129173
'fieldPresentation' => array(
130174
'class' => 'statistics:Entity',
131175
'config' => 'saml20-sp-remote',
132176
),
133-
'slot' => 60*60*24, // Slots of one day
134-
'fileslot' => 60*60*24*30, // 30 days of data in each file
135-
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
136-
137-
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
138-
'dateformat-intra' => 'j. M', // 4. Mars
139177
),
140-
'slo_days' => array(
141-
'name' => 'Logout (per day for a month)',
142-
'descr' => 'The number of logouts divided into slots of one day. Each file contains data for 30 days.',
143-
178+
'ssoservicerealm' => array(
179+
'name' => 'SSO to service and realm',
180+
'descr' => 'The number of logins per realm and service provider.',
181+
'action' => 'saml20-idp-SSO',
182+
'col' => array(6,8), // Service Provider EntityID, realm
183+
'fieldPresentation' => array(
184+
'class' => 'feide:SPandOrg',
185+
'config' => 'saml20-sp-remote',
186+
),
187+
),
188+
'ssorealm' => array(
189+
'name' => 'SSO by realm',
190+
'descr' => 'The number of logins at a Service Provider divided into slots of one day. Each file contains data for 80 days',
191+
'action' => 'saml20-idp-SSO',
192+
'col' => 8, // Realm
193+
'fieldPresentation' => array(
194+
'class' => 'feide:Org',
195+
'config' => 'saml20-sp-remote',
196+
),
197+
),
198+
'slo' => array(
199+
'name' => 'Logout',
200+
'descr' => 'The number of initated Sinlge Logout.',
144201
'action' => 'saml20-idp-SLO',
145202
'col' => 7, // Service Provider EntityID that initiated the logout.
146203
'fieldPresentation' => array(
147204
'class' => 'statistics:Entity',
148205
'config' => 'saml20-sp-remote',
149206
),
150-
'slot' => 60*60*24, // Slots of one day
151-
'fileslot' => 60*60*24*30, // 30 days of data in each file
152-
'axislabelint' => 7, // Number of slots per label. 7 days => 1 week
153-
154-
'dateformat-period' => 'j. M Y H:i', // 4. Mars 12:30
155-
'dateformat-intra' => 'j. M', // 4. Mars
156207
),
157-
158-
),
208+
'consent' => array(
209+
'name' => 'Consent',
210+
'descr' => 'Consent statistics. Everytime a user logs in to a service an entry is logged for one of three states: consent was found, consent was not found or consent storage was not available.',
211+
'action' => 'consent',
212+
'col' => 6,
213+
'fieldPresentation' => array(
214+
'class' => 'statistics:Entity',
215+
'config' => 'saml20-sp-remote',
216+
),
217+
),
218+
'consentresponse' => array(
219+
'name' => 'Consent response',
220+
'descr' => 'Consent response statistics. Everytime a user accepts consent, it is logged whether the user selected to remember the consent to next time.',
221+
'action' => 'consentResponse',
222+
'col' => 6,
223+
'fieldPresentation' => array(
224+
'class' => 'statistics:Entity',
225+
'config' => 'saml20-sp-remote',
226+
),
227+
),
159228

160229
);
161230

162-
?>

modules/statistics/hooks/hook_frontpage.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ function statistics_hook_frontpage(&$links) {
1313
'text' => array('en' => 'Show statistics', 'no' => 'Vis statistikk'),
1414
'shorttext' => array('en' => 'Statistics', 'no' => 'Statistikk'),
1515
);
16+
$links['links']['statisticsmeta'] = array(
17+
'href' => SimpleSAML_Module::getModuleURL('statistics/statmeta.php'),
18+
'text' => array('en' => 'Show statistics metadata', 'no' => 'Vis statistikk metadata'),
19+
'shorttext' => array('en' => 'Statistics metadata', 'no' => 'Statistikk metadata'),
20+
);
1621

1722
}
1823
?>

0 commit comments

Comments
 (0)