rrdreel

Check-in [7cf461ae72]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Simplify rra code
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:7cf461ae723eeadf136905b37b6034035a0fdfebf98462905b6e56ac04b77f6d
User & Date: jef 2018-08-29 21:12:02
Context
2018-08-29
21:16
Update description check-in: 38dd1dd1fc user: jef tags: trunk
21:12
Simplify rra code check-in: 7cf461ae72 user: jef tags: trunk
21:06
Switch to tcl implementation check-in: fc74e44c02 user: jef tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rrdreel.

62
63
64
65
66
67
68
69

70
71

72
73
74
75
76
77
78

	method rras {} {
		set step [dict get $params step]
		set rras {}
		foreach ts [my timeslots] {
			set ndata [expr {int(ceil([dict get $ts range] / $step))}]
			if {$ndata < $graph_width} {
				lassign [list 1 $ndata] steps rows

			} else {
				lassign [list [expr {int(ceil($ndata / $graph_width))}] $graph_width] steps rows

			}

			if {[dict exists $rras $steps]} {
				dict set rras $steps [expr max($rows, [dict get $rras $steps])]
			} else {
				dict set rras $steps $rows
			}







|
>

|
>







62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80

	method rras {} {
		set step [dict get $params step]
		set rras {}
		foreach ts [my timeslots] {
			set ndata [expr {int(ceil([dict get $ts range] / $step))}]
			if {$ndata < $graph_width} {
				set steps 1
				set rows $ndata
			} else {
				set steps [expr {int($ndata / $graph_width)}]
				set rows $graph_width
			}

			if {[dict exists $rras $steps]} {
				dict set rras $steps [expr max($rows, [dict get $rras $steps])]
			} else {
				dict set rras $steps $rows
			}