Skip to content

Commit

Permalink
Add plots for week and month. Click for larger.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thynix committed Oct 8, 2012
1 parent f58bc51 commit f521220
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 29 deletions.
57 changes: 32 additions & 25 deletions analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,31 +315,38 @@ def binarySearch(distinctSamples, samples):
#
firstResult = toPosix(timestamp(db.execute(""" select min("time") from "identifier" """).fetchone()[0]))
lastResult = rrdtool.last(args.rrd)
rrdtool.graph( args.sizeGraph,
'--start', str(firstResult),
'--end', str(lastResult),
'DEF:instantaneous-size={0}:instantaneous-size:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'DEF:effective-size={0}:effective-size:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'LINE2:instantaneous-size#FF0000:Hourly Instantaneous',
'LINE2:effective-size#0000FF:Weekly Effective',
'-v', 'Size Estimate',
'--right-axis', '1:0',
'--full-size-mode',
'--width', '900',
'--height', '300'
)

rrdtool.graph( args.storeGraph,
'--start', str(firstResult),
'--end', str(lastResult),
'DEF:store-capacity={0}:store-capacity:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'AREA:store-capacity#0000FF',
'-v', 'Store Capacity',
'--right-axis', '1:0',
'--full-size-mode',
'--width', '900',
'--height', '300'
)

# Month: 3600 * 24 * 30 = 2592000 seconds
# Week: 3600 * 24 * 7 = 604800 seconds
# Period name, start.
for period in [ ('all', firstResult), ('month', lastResult - 2592000), ('week', lastResult - 604800) ]:
# Width, height.
for dimension in [ (900, 300), (1200, 400) ]:
rrdtool.graph( '{0}_{1}x{2}_{3}'.format(period[0], dimension[0], dimension[1], args.sizeGraph),
'--start', str(period[1]),
'--end', str(lastResult),
'DEF:instantaneous-size={0}:instantaneous-size:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'DEF:effective-size={0}:effective-size:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'LINE2:instantaneous-size#FF0000:Hourly Instantaneous',
'LINE2:effective-size#0000FF:Weekly Effective',
'-v', 'Size Estimate',
'--right-axis', '1:0',
'--full-size-mode',
'--width', str(dimension[0]),
'--height', str(dimension[1])
)

rrdtool.graph( '{0}_{1}x{2}_{3}'.format(period[0], dimension[0], dimension[1], args.storeGraph),
'--start', str(period[1]),
'--end', str(lastResult),
'DEF:store-capacity={0}:store-capacity:AVERAGE:step={1}'.format(args.rrd, int(totalSeconds(shortPeriod))),
'AREA:store-capacity#0000FF',
'-v', 'Store Capacity',
'--right-axis', '1:0',
'--full-size-mode',
'--width', str(dimension[0]),
'--height', str(dimension[1])
)

if args.runLocation:
log("Querying database for locations.")
Expand Down
29 changes: 26 additions & 3 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,33 @@ Freenet Statistics

## Network Size

<!--- TODO: Past month; week as well -->
<!--- TODO: Vertical lines at configuration changes and build release/mandatory. -->

<img src="plot_network_size.png" alt="Plot of all available network size estimates" title="All available data" width="900" height="300"/>
### Past Week

<a href="week_1200x400_plot_network_size.png"><img src="week_900x300_plot_network_size.png" alt="Plot of the last 7 days of network size estimates" title="Last 7 days" width="900" height="300"/></a>

### Past Month

<a href="month_1200x400_plot_network_size.png"><img src="month_900x300_plot_network_size.png" alt="Plot of the last 30 days of network size estimates" title="Last 30 days" width="900" height="300"/></a>

### All Data

<a href="all_1200x400_plot_network_size.png"><img src="all_900x300_plot_network_size.png" alt="Plot of all available network size estimates" title="All available data" width="900" height="300"/></a>

## Store Capacity

<img src="plot_store_capacity.png" alt="Plot of all available store capacity data" title="All available data" width="900" height="300"/>
### Past Week

<a href="week_1200x400_plot_store_capacity.png"><img src="week_900x300_plot_store_capacity.png" alt="Plot of the last 7 days of store capacity data" title="Last 7 days" width="900" height="300"/></a>

### Past Month

<a href="month_1200x400_plot_store_capacity.png"><img src="month_900x300_plot_store_capacity.png" alt="Plot of the last 30 days of store capacity data" title="Last 30 days" width="900" height="300"/></a>

### All Data

<a href="all_1200x400_plot_store_capacity.png"><img src="all_900x300_plot_store_capacity.png" alt="Plot of all available store capacity data" title="All available data" width="900" height="300"/></a>

<!--- TODO: Graphs of error; refual occurances. -->

Expand All @@ -38,6 +57,10 @@ Link length and peer count are from the past 7 days of results. All peer counts

## Changelog

### October 7th, 2012

Add plots of the past week and month of network size and store capacity. Click for a larger version.

### September 10th, 2012

Correct September 3rd changelog entry. Improve HTML output to meet XHTML 1.1.
Expand Down
2 changes: 1 addition & 1 deletion upload.config_sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ path=statistics

# Semicolon-separated list of paths to files to insert, relative to the
# analyze script location.
insertFiles=index.html;plot_network_size.png;plot_store_capacity.png;plot_link_length.png;plot_peer_count.png;activelink.png;size.xml
insertFiles=index.html;plot_link_length.png;plot_peer_count.png;activelink.png;size.xml;all_900x300_plot_network_size.png;all_900x300_plot_store_size.png;all_1200x400_plot_network_size.png;all_1200x400_plot_store_size.png;month_900x300_plot_network_size.png;month_900x300_plot_store_size.png;month_1200x400_plot_network_size.png;month_1200x400_plot_store_size.png;week_900x300_plot_network_size.png;week_900x300_plot_store_size.png;week_1200x400_plot_network_size.png;week_1200x400_plot_store_size.png

# FCP Host.
host=127.0.0.1
Expand Down

0 comments on commit f521220

Please sign in to comment.