Project:LHS Graphs and Visualizations: Difference between revisions

From London Hackspace Wiki
m (→‎Metrics: Babbage deprecation)
 
(90 intermediate revisions by 10 users not shown)
Line 1: Line 1:
__NOTOC__
{{Project|members=[[User:Teabot|Elliot]]}}
{{Project|members=[[User:Teabot|Elliot]]}}
===Overview===
==Overview==
I'd like to supplement [http://hack.rs/cacti/graph_view.php?action=tree&tree_id=1 the Cacti graphs] that we have for LHS bandwidth and power with metrics that provide insight to the growth of our community and organisation over time.
I have supplemented [http://hack.rs/cacti/graph_view.php?action=tree&tree_id=1 the Cacti graphs] that we have for LHS bandwidth and power with [http://hack.rs/cacti/graph_view.php?action=tree&tree_id=5 metrics] that provide insight to the growth of our community and organisation over time.


To chart the metrics various bits of data are exposed in a Cacti friendly way.


Initially I'd like to chart the following:
==Metrics==
===Number of members===


* Number of members
We may have to wait 12 months before it becomes interesting.
* Mailing list activity
* Wiki activity
* Website visitors and/or page impressions


 
This data is stored in an Sqlite database on [[Turing]].  See the [https://github.com/londonhackspace/hackspace-foundation-sites/blob/master/etc/schema.sql Schema]. It can be queried like so:
Later I'd like to investigate:
 
* Space occupancy
 
==Phase 1==
To chart the initial metrics various bits of data will need to be exposed in a Cacti friendly way. I need help in getting access to these data sources so that I can write the various data input methods.
 
====Number of members====
This data is stored in a database on [[Turing]].  See the [https://github.com/londonhackspace/hackspace-foundation-sites/blob/master/etc/schema.sql Schema]. It can be queried like so:


   SELECT COUNT(id)
   SELECT COUNT(id)
Line 27: Line 16:
   WHERE subscribed = true;
   WHERE subscribed = true;


And for pending users:
Cacti runs on chomsky but the members database is on Turing. There is a PHP script on Turing to expose the member numbers and then a script on chomsky to pull this in with a HTTP request.


  SELECT COUNT(id)
''Code:'' https://github.com/londonhackspace/monitoring
  FROM users
  WHERE subscribed = false;


To import historic data into rrdtool we can look at the date of members first payments:
''URL:'' http://london.hackspace.org.uk/member_stats.php


  SELECT t1.timestamp, COUNT(t1.id)
===IRC statistics===
  FROM transactions t1
''See project: [[Project:Ircensus|ircensus]]''
  LEFT JOIN transactions AS t2 ON t1.user_id = t2.user_id
  AND t1.timestamp > t2.timestamp
  WHERE t2.timestamp IS NULL
  GROUP BY t1.timestamp;


The bash script to generate the following cacti output:
===Wiki statistics===
  subscribed:136 pending:2
* We get this using the MediaWiki API:
Is:
  // TODO: Write the bash script
 
====Mailing list activity====
* There is no API for Google Groups. Perhaps poll the RSS feed and count unrecognized message ids or look at the date?
 
  https://groups.google.com/group/london-hack-space/feed/rss_v2_0_msgs.xml?num=50
 
* We can also calculate the size of the list (members) from the [http://groups.google.com/support/bin/answer.py?hl=en&answer=46398 mailing list download]
 
====Wiki statistics====
* We can get this using the MediaWiki API:


   http://wiki.hackspace.org.uk/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml
   http://wiki.hackspace.org.uk/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml


Returns:
It returns:


   <?xml version="1.0"?>
   <?xml version="1.0"?>
Line 78: Line 49:
   </api>
   </api>


And the perl to generate the following output for cacti:


  pages:759 articles:215 views:229656 edits:7368 images:186 users:166 activeusers:22 admins:61 jobs:13
A Perl script generates the following output for cacti: '''<tt>pages:759 articles:215 views:229656 edits:7368 images:186 users:166 activeusers:22 admins:61 jobs:13</tt>'''
 
''Code:'' https://github.com/londonhackspace/monitoring
 
===Mailing list activity===
 
* My thanks to JamesG for his assistance and '78.86.160.161' for the original idea. We poll and scrape the groups page for members and and message count.


Is:
  http://groups.google.com/group/london-hack-space


  // TODO: Write the perl script
We have a script that outputs: '''<tt>members:693 messages:3123</tt>'''


====Website visitors and/or page impressions====
''Code:'' https://github.com/londonhackspace/monitoring
The main site and the Wiki use Google Analytics and this has an API. This [http://code.google.com/apis/analytics/docs/gdata/gdataCommonQueries.html documented method] looks promising:
  https://www.google.com/analytics/feeds/data?metrics=ga%3Avisits%2Cga%3Apageviews&start-date=2010-11-29&end-date=2010-12-13&max-results=50


==Phase 2==
===Space occupancy===
''See project: [[Project:Spacensus|spacensus]]''


====Space occupancy====
[[Category:Projects]]
* We could use a directional IR occupancy counter. I think that we already have something like this in the LHS stores.
[[Category:Infrastructure]]
[[Category:Space_Infrastructure_Projects]]

Latest revision as of 11:52, 5 January 2016

LHS Graphs and Visualizations


Members Elliot
QR code

Overview

I have supplemented the Cacti graphs that we have for LHS bandwidth and power with metrics that provide insight to the growth of our community and organisation over time.

To chart the metrics various bits of data are exposed in a Cacti friendly way.

Metrics

Number of members

We may have to wait 12 months before it becomes interesting.

This data is stored in an Sqlite database on Turing. See the Schema. It can be queried like so:

 SELECT COUNT(id)
 FROM users
 WHERE subscribed = true;

Cacti runs on chomsky but the members database is on Turing. There is a PHP script on Turing to expose the member numbers and then a script on chomsky to pull this in with a HTTP request.

Code: https://github.com/londonhackspace/monitoring

URL: http://london.hackspace.org.uk/member_stats.php

IRC statistics

See project: ircensus

Wiki statistics

  • We get this using the MediaWiki API:
 http://wiki.hackspace.org.uk/w/api.php?action=query&meta=siteinfo&siprop=statistics&format=xml

It returns:

 <?xml version="1.0"?>
 <api>
   <query>
     <statistics
       pages="759"
       articles="215"
       views="229656"
       edits="7368"
       images="186"
       users="166"
       activeusers="22"
       admins="61"
       jobs="13"
     />
   </query>
 </api>


A Perl script generates the following output for cacti: pages:759 articles:215 views:229656 edits:7368 images:186 users:166 activeusers:22 admins:61 jobs:13

Code: https://github.com/londonhackspace/monitoring

Mailing list activity

  • My thanks to JamesG for his assistance and '78.86.160.161' for the original idea. We poll and scrape the groups page for members and and message count.
 http://groups.google.com/group/london-hack-space

We have a script that outputs: members:693 messages:3123

Code: https://github.com/londonhackspace/monitoring

Space occupancy

See project: spacensus