mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-22 06:13:25 -07:00
max concurrent streams in graph
This commit is contained in:
parent
4f8d0434eb
commit
b552143b2a
3 changed files with 27 additions and 5 deletions
|
@ -816,7 +816,6 @@
|
|||
hc_plays_by_platform_options.tooltip.formatter = tooltip_format;
|
||||
hc_plays_by_user_options.tooltip.formatter = tooltip_format;
|
||||
hc_plays_by_stream_type_options.tooltip.formatter = tooltip_format;
|
||||
hc_concurrent_streams_by_stream_type_options.tooltip.formatter = tooltip_format;
|
||||
hc_plays_by_source_resolution_options.tooltip.formatter = tooltip_format;
|
||||
hc_plays_by_stream_resolution_options.tooltip.formatter = tooltip_format;
|
||||
hc_plays_by_platform_by_stream_type_options.tooltip.formatter = tooltip_format;
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
var formatter_function = function() {
|
||||
if (moment(this.x, 'X').isValid() && (this.x > 946684800)) {
|
||||
var s = '<b>'+ moment(this.x).format('ddd MMM D') +'</b>';
|
||||
} else {
|
||||
var s = '<b>'+ this.x +'</b>';
|
||||
}
|
||||
$.each(this.points, function(i, point) {
|
||||
s += '<br/>'+point.series.name+': '+point.y;
|
||||
});
|
||||
return s;
|
||||
};
|
||||
|
||||
var hc_concurrent_streams_by_stream_type_options = {
|
||||
chart: {
|
||||
type: 'line',
|
||||
|
@ -57,7 +69,8 @@ var hc_concurrent_streams_by_stream_type_options = {
|
|||
},
|
||||
tooltip: {
|
||||
shared: true,
|
||||
crosshairs: true
|
||||
crosshairs: true,
|
||||
formatter: formatter_function
|
||||
},
|
||||
series: [{}]
|
||||
};
|
|
@ -879,8 +879,10 @@ class Graphs(object):
|
|||
series_1 = []
|
||||
series_2 = []
|
||||
series_3 = []
|
||||
series_4 = []
|
||||
|
||||
grouped_result = helpers.group_by_keys(result, ('date_played','transcode_decision'))
|
||||
grouped_result_by_stream_type = helpers.group_by_keys(result, ('date_played','transcode_decision'))
|
||||
grouped_result_by_day = helpers.group_by_keys(result, ['date_played'])
|
||||
|
||||
for date_item in sorted(date_list):
|
||||
date_string = date_item.strftime('%Y-%m-%d')
|
||||
|
@ -888,8 +890,9 @@ class Graphs(object):
|
|||
series_1_value = 0
|
||||
series_2_value = 0
|
||||
series_3_value = 0
|
||||
series_4_value = 0
|
||||
|
||||
for item in grouped_result:
|
||||
for item in grouped_result_by_stream_type:
|
||||
if item['key'] == (date_string,'direct play'):
|
||||
series_1_value = calc_most_concurrent(item['value'])
|
||||
elif item['key'] == (date_string,'copy'):
|
||||
|
@ -897,9 +900,14 @@ class Graphs(object):
|
|||
elif item['key'] == (date_string,'transcode'):
|
||||
series_3_value = calc_most_concurrent(item['value'])
|
||||
|
||||
for item in grouped_result_by_day:
|
||||
if item['key'] == date_string:
|
||||
series_4_value = calc_most_concurrent(item['value'])
|
||||
|
||||
series_1.append(series_1_value)
|
||||
series_2.append(series_2_value)
|
||||
series_3.append(series_3_value)
|
||||
series_4.append(series_4_value)
|
||||
|
||||
series_1_output = {'name': 'Direct Play',
|
||||
'data': series_1}
|
||||
|
@ -907,9 +915,11 @@ class Graphs(object):
|
|||
'data': series_2}
|
||||
series_3_output = {'name': 'Transcode',
|
||||
'data': series_3}
|
||||
series_4_output = {'name': 'Max. Concurrent Streams',
|
||||
'data': series_4}
|
||||
|
||||
output = {'categories': categories,
|
||||
'series': [series_1_output, series_2_output, series_3_output]}
|
||||
'series': [series_1_output, series_2_output, series_3_output, series_4_output]}
|
||||
return output
|
||||
|
||||
def get_total_plays_by_source_resolution(self, time_range='30', y_axis='plays', user_id=None, grouping=None):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue