Skip to content

This application provides a way to get Confluence Usage metrics - Atlassian Codegeist 2013

License

Notifications You must be signed in to change notification settings

rkadam/confluence-metrics

Repository files navigation

confluence-metrics

This application provides way to get Confluence Usage metrics - Atlassian Codegeist 2013


Year 2018 Updates

Now you can use Page View for Confluence Add-on as it provides all this information in friendly manner; also cost is very less!


Postgres Database Setup

  • Create Postgres Database to store analyzed log entries.
  • NOTE: It's advised you don't use your PRODUCTION JIRA database!
createdb -O <jiraowner-E UNICODE <databasename>
createdb -O jira -E UNICODE metricsdb;
  • Create a table to store logentires;
psql metricsdb;

metricsdb=#CREATE TABLE logentries (
    userid character varying(255),
    ipaddress character varying(255),
    actiontype character varying(255),
    useraction character varying(255),
    usersubaction character varying(255),
    unknownactionurl character varying(255),
    spacekey character varying(255),
    title character varying(255),
    pageid character varying(255),
    querystring character varying(255),
    datetimestamp timestamp without time zone,
    actionname character varying(255)
);
  • That's our setup to store confluence metrics information!

Confluence Access Log Generation Setup

Refer to this link on how to get this done : https://confluence.atlassian.com/display/CONFKB/How+to+Enable+User+Access+Logging

Confluence Offline Metrics plugin setup

  • Get source from GitHub repository https://github.com/sillycat/confluence-metrics
  • It should create directory confluence-metrics and will have these files -> analyze.py, wikiurl.py and logentry.py and empty "logs" directory.
  • Edit analyze.py to enter correct values for database, user, password and host.

It's time to analyze the metrics

  • Copy all altassian-confluence-access.log files that you want to analyze (remember there is one file for each day!) into logs directory.
  • For each log file that you want to analyze run following command.
    ./analyze.py <log file name>
    ./analyze.py logs/atlassian-confluence-access.log.2013-02-08
    ./analyze.py logs/atlassian-confluence-access.log.2013-02-09

P.S.: Please note that application creates intermediate csv file (log.csv) which we later import into database table.

  • Please remember if you analyze same log file again, it will add duplicate entries into database.
  • verify if entries are created or not
    metricsdb=# select count(*) from logentries;

Query to generate chart data

  • To get all the pages that got top hits
  • To get total view hits per space
metricsdb=> select spacekey || ' - ' || title , count(*) 
from logentries 
where useraction = 'view' and usersubaction='page' and spacekey != '' group by title, spacekey 
order by count(*) desc;

metricsdb=> select spacekey, count(*) 
from logentries 
where spacekey != '' and useraction = 'view'
group by spacekey;
Page TitleHits
Autodesk 3D Tour461
Challenge Post Wiki - Home Page50
HR Home Page24
AUG - SF Home18
AUG - EBAY Home10
Wiki SpacePage Views
HOME472
SALES147
HR58
GAMERS52
IT25

Use this data along with Chart macro to display data in graphical format.

Contributors

  • Raju Kadam

License

Copyright (c) 2013, Rajendra Kadam, released under a [BSD-style License][lic]. [lic]: http://github.com/sillycat/confluence_metrics_plugin/blob/master/LICENSE.txt

About

This application provides a way to get Confluence Usage metrics - Atlassian Codegeist 2013

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages