Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1s committed Oct 28, 2018
1 parent 37b5f12 commit 843ada0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions emby_exporter/emby_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from prometheus_client import Gauge, make_wsgi_app
from wsgiref.simple_server import WSGIRequestHandler, WSGIServer, make_server

__VERSION__ = '0.1.2'
__VERSION__ = '0.1.3'


class metric:
Expand All @@ -48,11 +48,8 @@ def update_value(self, value):
class metric_label:
def __init__(self, name, value, label=None):
self.name = name
if not label:
label = [*value.keys()][0]
self.values = dict()
self.label_values = list()
self.label_values.append(label)
self.metric = Gauge('%s' % name.lower(), name.replace('_', ' '),
[label])
self.update_value(value)
Expand Down Expand Up @@ -245,16 +242,6 @@ def update_stats(self, data):
self.metrics[i] = self.add_update_metric_label(
'emby_%s' % t.lower(), user_data[t], 'type')

for t in stats:
for i in stats[t]:
if i == 'user_data':
if 'played' in stats[t]['user_data']:
self.metrics['played'].labels(t).set(
stats[t]['user_data']['played'])
if 'isfavourite' in stats[t]['user_data']:
self.metrics['favourite'].labels(t).set(
stats[t]['user_data']['isfavourite'])

def update_metrics(self):

self.emby.update_sync()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='emby_exporter',
version='0.1.2',
version='0.1.3',
url='https://github.com/dr1s/emby_exporter.py',
author='dr1s',
license='MIT',
Expand Down

0 comments on commit 843ada0

Please sign in to comment.