yfinance-exporter 1.0.9__py3-none-any.whl → 1.0.11__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yfinance-exporter
3
- Version: 1.0.9
3
+ Version: 1.0.11
4
4
  Summary:
5
5
  Author: François Schmidts
6
6
  Author-email: francois@schmidts.fr
@@ -0,0 +1,4 @@
1
+ yfinance_exporter.py,sha256=eTQD2xprQ9KOC6ORnuJBxVBgAU46I04eavtmxpwajLU,4356
2
+ yfinance_exporter-1.0.11.dist-info/METADATA,sha256=r10fDiIp6KMZML7STuDXqG1lbQYHfYlGslBC2wv9ZVc,1526
3
+ yfinance_exporter-1.0.11.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
4
+ yfinance_exporter-1.0.11.dist-info/RECORD,,
yfinance_exporter.py CHANGED
@@ -95,15 +95,15 @@ def update_state(result: bool, key: str, states: dict, labels: dict):
95
95
  previous = states.get(key)
96
96
  states[key] = result
97
97
  if previous == result:
98
- logger.debug("%r: result %r => %r UNCHANGED", key, previous, result)
98
+ logger.debug("%s(%r => %r) UNCHANGED", key, previous, result)
99
99
  return
100
100
  inc_key, dec_key = "items-ok", "items-ko"
101
101
  if not result:
102
102
  inc_key, dec_key = "items-ko", "items-ok"
103
- logger.debug("%s(%r => %r) %s-1", key, previous, result, inc_key)
103
+ logger.debug("%s(%r => %r) %r +1", key, previous, result, inc_key)
104
104
  DAEMON.labels(status=inc_key, **labels).inc()
105
105
  if previous is not None:
106
- logger.debug("%s(%r => %r) %s-1", key, previous, result, dec_key)
106
+ logger.debug("%s(%r => %r) %r -1", key, previous, result, dec_key)
107
107
  DAEMON.labels(status=dec_key, **labels).dec()
108
108
 
109
109
 
@@ -117,9 +117,6 @@ def main():
117
117
  states = {}
118
118
  while True:
119
119
  start = datetime.now()
120
- DAEMON.labels(status="items-ok", **labels).set(0)
121
- DAEMON.labels(status="items-ko", **labels).set(0)
122
-
123
120
  for stock in conf.stocks:
124
121
  result = collect(stock)
125
122
  update_state(result, stock.isin, states, labels)
@@ -131,6 +128,7 @@ def main():
131
128
  DAEMON.labels(status="loop-count", **labels).inc()
132
129
  interval = int(conf.loop.interval - exec_interval)
133
130
  if interval > 0:
131
+ logger.debug("Waiting %d to complete the loop interval", interval)
134
132
  time.sleep(interval)
135
133
 
136
134
 
@@ -1,4 +0,0 @@
1
- yfinance_exporter.py,sha256=roRbAtpbrxqTm2sfrtQ1m05lR3_l_jPOE5NvuO1HSlM,4399
2
- yfinance_exporter-1.0.9.dist-info/METADATA,sha256=OmEs0MDnOInsiDlwHMYgPNS-Sezp4slFlZG_y-Fzjnc,1525
3
- yfinance_exporter-1.0.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
4
- yfinance_exporter-1.0.9.dist-info/RECORD,,