Ralph Bean avatar Ralph Bean committed 1f4314d

Pointing samples at the right file locations.

Comments (0)

Files changed (1)

tw2/rrd/samples.py

 import tw2.core as twc
 import tw2.rrd
 
+import sys
 import datetime
 
-data_directory = '/'.join(__file__.split('/')[:-1]) + '/data'
+arch = ['32', '64'][sys.maxsize > 2**32]
+data_directory = '/'.join(__file__.split('/')[:-1] + ['data', arch])
 
-class DemoDirectoryRRDJitBarChart(tw2.rrd.DirectoryRRDJitBarChart):
+class DemoNestedRRDJitBarChart(tw2.rrd.NestedRRDJitBarChart):
     rrd_directories = [
-        data_directory + 'directories/filename/' + country
+        data_directory + 'nested/filename/' + country
         for country in [
             'Brazil/',
             'Canada/',
 
 class DemoFlatRRDJitAreaChart(tw2.rrd.FlatRRDJitAreaChart):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_wio.rrd',
-        data_directory + '/cpu_system.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
+        data_directory + '/flat/cpu_system.rrd',
     ]
     steps = 25
     timedelta = datetime.timedelta(days=90)
 
 class DemoFlatRRDFlotWidget(tw2.rrd.FlatRRDFlotWidget):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
 
 class DemoFlatRRDProtoBarChart(tw2.rrd.FlatRRDProtoBarChart):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
 
     def series_sorter(self, x, y):
 
 class DemoFlatRRDProtoBubbleChart(tw2.rrd.FlatRRDProtoBubbleChart):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
 
     # Sort alphabetically
 
 class DemoFlatRRDProtoLineChart(tw2.rrd.FlatRRDProtoLineChart):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
 
 class DemoFlatRRDProtoStackedAreaChart(tw2.rrd.FlatRRDProtoStackedAreaChart):
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
 
 class DemoFlatRRDStreamGraph(tw2.rrd.FlatRRDStreamGraph):
     logarithmic = True
     rrd_filenames = [
-        data_directory + '/cpu_user.rrd',
-        data_directory + '/cpu_system.rrd',
-        data_directory + '/cpu_wio.rrd',
+        data_directory + '/flat/cpu_user.rrd',
+        data_directory + '/flat/cpu_system.rrd',
+        data_directory + '/flat/cpu_wio.rrd',
     ]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.