rda-python-metrics 1.0.15__py3-none-any.whl → 1.0.17__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.

Potentially problematic release.


This version of rda-python-metrics might be problematic. Click here for more details.

@@ -262,11 +262,11 @@ def fill_cdg_usages(dsids, dranges):
262
262
  trecs[tkey]['size'] += dsize
263
263
  trecs[tkey]['fcount'] += 1
264
264
  else:
265
- wurec = get_wuser_record(ip)
266
- if not wurec: return 0
267
- trecs[tkey] = {'ip' : ip, 'dsid' : dsid, 'date' : cdate, 'time' : time, 'size' : dsize,
268
- 'fcount' : 1, 'method' : method, 'etype' : etype, 'engine' : engine,
269
- 'org_type' : wurec['org_type'], 'country' : wurec['country'],
265
+ wurec = get_wuser_record(ip, cdate)
266
+ if not wurec: continue
267
+ trecs[tkey] = {'ip' : ip, 'dsid' : dsid, 'date' : cdate, 'time' : time, 'quarter' : quarter,
268
+ 'size' : dsize, 'fcount' : 1, 'method' : method, 'etype' : etype,
269
+ 'engine' : engine, 'org_type' : wurec['org_type'], 'country' : wurec['country'],
270
270
  'email' : wurec['email']}
271
271
  else:
272
272
  # web usage
@@ -353,7 +353,7 @@ def add_webfile_usage(year, logrec):
353
353
  cond = "wid = {} AND method = '{}' AND date_read = '{}' AND time_read = '{}'".format(logrec['wid'], logrec['method'], cdate, logrec['time'])
354
354
  if PgDBI.pgget(table, "", cond, PgLOG.LOGWRN): return 0
355
355
 
356
- wurec = get_wuser_record(ip, cdate, False)
356
+ wurec = get_wuser_record(ip, cdate)
357
357
  if not wurec: return 0
358
358
 
359
359
  record = {'wid' : logrec['wid'], 'dsid' : logrec['dsid']}
@@ -418,7 +418,7 @@ def get_wfile_record(dsids, wfile):
418
418
  return pgrec
419
419
 
420
420
  # return wuser record upon success, None otherwise
421
- def get_wuser_record(ip, date = None, skipwuid = True):
421
+ def get_wuser_record(ip, date = None):
422
422
 
423
423
  if ip in WUSERS: return WUSERS[ip]
424
424
 
@@ -427,16 +427,11 @@ def get_wuser_record(ip, date = None, skipwuid = True):
427
427
 
428
428
  record = {'org_type' : ipinfo['org_type'], 'country' : ipinfo['country']}
429
429
  email = 'unknown@' + ipinfo['hostname']
430
- if skipwuid:
431
- record['email'] = email
432
- WUSERS[ip] = record
433
- return record
434
-
435
430
  emcond = "email = '{}'".format(email)
436
431
  flds = 'wuid, email, org_type, country, start_date'
437
432
  pgrec = PgDBI.pgget("wuser", flds, emcond, PgLOG.LOGERR)
438
433
  if pgrec:
439
- if PgUtil.diffdate(pgrec['start_date'], date) > 0:
434
+ if date and PgUtil.diffdate(pgrec['start_date'], date) > 0:
440
435
  pgrec['start_date'] = record['start_date'] = date
441
436
  PgDBI.pgupdt('wuser', record, emcond)
442
437
  WUSERS[ip] = pgrec
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_metrics
3
- Version: 1.0.15
3
+ Version: 1.0.17
4
4
  Summary: RDA Python Package to gather and view data usage metrics
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-metrics
@@ -3,7 +3,7 @@ rda_python_metrics/PgView.py,sha256=r6otb3DjfiaQJdg0z8bZQAOlhr4JnrXJzp9wgWh_8qQ,
3
3
  rda_python_metrics/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
4
4
  rda_python_metrics/fillawsusage.py,sha256=dpI3-EFINJECdCSUOm37A97CJNIxOS2nYwA0fB0IpHE,9055
5
5
  rda_python_metrics/fillawsusage.usg,sha256=pD_nYTfg1so9nvVEyPSWdgKvb9gWdtfHJAs3RsT2MMU,609
6
- rda_python_metrics/fillcdgusage.py,sha256=chIkU5pCP6zSdoQNLYGEfXZFvEXL1pBRXwj7hMjGv4A,15743
6
+ rda_python_metrics/fillcdgusage.py,sha256=u8sclbsNJaZJ_hJxvZAhaGGppCPBh6WiBLnJM8GoMi8,15663
7
7
  rda_python_metrics/fillcdgusage.usg,sha256=5lkd4Zdi72nQcha-JtbaLnxl66V4wBDykKwQtUOtMrw,667
8
8
  rda_python_metrics/fillcodusage.py,sha256=Hp3VrlIqHBWRI6Zjbi0nxWZPNvPrKsGBSZ1L9qA9_y0,8006
9
9
  rda_python_metrics/fillcodusage.usg,sha256=3B5IkQ4uwylqY8uEfUdnZ_MXqhYudeylMp5ulhUGXH8,678
@@ -44,9 +44,9 @@ rda_python_metrics/viewwebfile.py,sha256=HSMNkQQawonu6W3blV7g9UbJuNy9VAOn9COqgmj
44
44
  rda_python_metrics/viewwebfile.usg,sha256=lTNi8Yu8BUJuExEDJX-vsJyWUSUIQTS-DiiBEVFo33s,10054
45
45
  rda_python_metrics/viewwebusage.py,sha256=jhoHuRPVNtp7Lbjv0l-Jy_vp2p2nWQC7IVZ0P4JUJ4I,16657
46
46
  rda_python_metrics/viewwebusage.usg,sha256=IsT72v22xyZf7ng_IodVs0dLTsH1Q4BtFvT-gs0-xJY,9946
47
- rda_python_metrics-1.0.15.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
48
- rda_python_metrics-1.0.15.dist-info/METADATA,sha256=ZjQTk2Zb7zim6WxxlSAKl30hT69EL3rG9oZjJGBsH1o,736
49
- rda_python_metrics-1.0.15.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
50
- rda_python_metrics-1.0.15.dist-info/entry_points.txt,sha256=YfFLzlE3rdufSV471VsDnfYptnt1lR08aSrxPXlKqlY,1185
51
- rda_python_metrics-1.0.15.dist-info/top_level.txt,sha256=aoBgbR_o70TP0QmMW0U6inRHYtfKld47OBmnWnLnDOs,19
52
- rda_python_metrics-1.0.15.dist-info/RECORD,,
47
+ rda_python_metrics-1.0.17.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
48
+ rda_python_metrics-1.0.17.dist-info/METADATA,sha256=uzy8JKTADowLHXZz5NwU6bVBt9i3rAkvfBpwEbTt8sA,736
49
+ rda_python_metrics-1.0.17.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
50
+ rda_python_metrics-1.0.17.dist-info/entry_points.txt,sha256=YfFLzlE3rdufSV471VsDnfYptnt1lR08aSrxPXlKqlY,1185
51
+ rda_python_metrics-1.0.17.dist-info/top_level.txt,sha256=aoBgbR_o70TP0QmMW0U6inRHYtfKld47OBmnWnLnDOs,19
52
+ rda_python_metrics-1.0.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.1)
2
+ Generator: setuptools (79.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5