rda-python-metrics 3.0.2__tar.gz → 3.0.3__tar.gz
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.
- {rda_python_metrics-3.0.2/src/rda_python_metrics.egg-info → rda_python_metrics-3.0.3}/PKG-INFO +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/pyproject.toml +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_oneorder.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillawsusage.usg +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcodusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filloneorder.py +1 -1
- rda_python_metrics-3.0.3/src/rda_python_metrics/fillzenodousage.usg +32 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/log_arch.py +23 -6
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/logarch.py +24 -7
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/logarch.usg +5 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_allusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_awsusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_checkusage.py +3 -3
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_codusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_ordusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_osdfusage.py +2 -2
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_rqstusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_tdsusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_webfile.py +8 -8
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_webusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewallusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewawsusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcheckusage.py +3 -3
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcodusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewordusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewosdfusage.py +2 -2
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewrqstusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewtdsusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebfile.py +8 -8
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebfile.usg +18 -19
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebusage.py +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3/src/rda_python_metrics.egg-info}/PKG-INFO +1 -1
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/SOURCES.txt +1 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/LICENSE +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/MANIFEST.in +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/README.md +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/setup.cfg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/PgIPInfo.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/PgView.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/__init__.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_awsusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_cdgusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_codusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_country.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_endtime.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_globususage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_ipinfo.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_osdfusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_rdadb.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_tdsusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_user.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillawsusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcdgusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcdgusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcodusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcountry.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillendtime.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillgdexusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillgdexusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillglobususage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillglobususage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillipinfo.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillipinfo.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filloneorder.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillosdfusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillosdfusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillrdadb.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillrdadb.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filltdsusage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filltdsusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filluser.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filluser.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillzenodousage.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pg_ipinfo.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pg_person.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pg_username.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pg_view.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pgperson.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pgsyspath.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/pgusername.py +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewallusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewawsusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcheckusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcodusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewordusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewosdfusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewrqstusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewtdsusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebusage.usg +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/dependency_links.txt +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/entry_points.txt +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/requires.txt +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/top_level.txt +0 -0
- {rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/tests/test_metrics.py +0 -0
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_oneorder.py
RENAMED
|
@@ -143,7 +143,7 @@ def check_inputs(params):
|
|
|
143
143
|
#
|
|
144
144
|
def check_specialist(dsid, specialist):
|
|
145
145
|
|
|
146
|
-
if specialist and PgDBI.pgget("dssgrp", "", "logname = '
|
|
146
|
+
if specialist and PgDBI.pgget("dssgrp", "", "logname = '{}'".format(specialist), PgLOG.LGEREX): return specialist
|
|
147
147
|
scond = "specialist = logname AND dsid = '{}' AND priority = 1".format(dsid)
|
|
148
148
|
pgrec = PgDBI.pgget("dsowner, dssgrp", "specialist", scond, PgLOG.LGEREX)
|
|
149
149
|
return pgrec['specialist'] if pgrec else "datahelp"
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillawsusage.usg
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
fillawsusage - Fill table 'awsusage' from AWS Server log files.
|
|
3
3
|
|
|
4
|
-
Reads AWS access logs from /gpfs/fs1/collections/rda/
|
|
4
|
+
Reads AWS access logs from /gpfs/fs1/collections/rda/transfer/AWSera5log/
|
|
5
5
|
and inserts usage records into the 'awsusage' table in PostgreSQL
|
|
6
6
|
database 'rdadb'.
|
|
7
7
|
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filloneorder.py
RENAMED
|
@@ -124,7 +124,7 @@ class FillONEOrder(PgUtil):
|
|
|
124
124
|
|
|
125
125
|
def check_specialist(self, dsid, specialist):
|
|
126
126
|
"""Return the dataset owner if specialist not given."""
|
|
127
|
-
if specialist and self.pgget("dssgrp", "", "logname = '
|
|
127
|
+
if specialist and self.pgget("dssgrp", "", "logname = '{}'".format(specialist), self.LGEREX): return specialist
|
|
128
128
|
scond = "specialist = logname AND dsid = '{}' AND priority = 1".format(dsid)
|
|
129
129
|
pgrec = self.pgget("dsowner, dssgrp", "specialist", scond, self.LGEREX)
|
|
130
130
|
return pgrec['specialist'] if pgrec else "datahelp"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
fillzenodousage - Fill table 'gdexzenodo' from Zenodo metrics.
|
|
3
|
+
|
|
4
|
+
Retrieves Zenodo usage info for GDEX-published datasets and inserts
|
|
5
|
+
records into the 'gdexzenodo' table in PostgreSQL database 'rdadb'.
|
|
6
|
+
|
|
7
|
+
USAGE:
|
|
8
|
+
fillzenodousage [-b] -s DatasetShortNames
|
|
9
|
+
(-m MonthList | -N NumberDays | -y YearList)
|
|
10
|
+
|
|
11
|
+
OPTIONS:
|
|
12
|
+
|
|
13
|
+
-s DatasetShortNames (required)
|
|
14
|
+
Gather usage info for the given dataset short names.
|
|
15
|
+
|
|
16
|
+
One of the following time-range options is required:
|
|
17
|
+
|
|
18
|
+
-m MonthList
|
|
19
|
+
Gather usage info for the given months.
|
|
20
|
+
Month format: YYYY-MM (e.g. 2024-01).
|
|
21
|
+
|
|
22
|
+
-N NumberDays
|
|
23
|
+
Gather usage info for the most recent NumberDays days.
|
|
24
|
+
|
|
25
|
+
-y YearList
|
|
26
|
+
Gather usage info for the given years.
|
|
27
|
+
Year format: YYYY (e.g. 2024).
|
|
28
|
+
|
|
29
|
+
-b Run in background mode (log to file only, no terminal output).
|
|
30
|
+
|
|
31
|
+
EXAMPLE:
|
|
32
|
+
fillzenodousage -s ds083.2 -y 2024
|
|
@@ -23,7 +23,7 @@ from rda_python_common import PgFile
|
|
|
23
23
|
from rda_python_common import PgSIG
|
|
24
24
|
|
|
25
25
|
# the defined options for archiving different logs
|
|
26
|
-
WLOG =
|
|
26
|
+
WLOG = 0x01 # archive web log
|
|
27
27
|
TLOG = 0x02 # archive tds log
|
|
28
28
|
DLOG = 0x04 # archive dssdb logs
|
|
29
29
|
SLOG = 0x08 # append dssdb sub batch logs
|
|
@@ -33,8 +33,8 @@ OLOG = 0x20 # archive OSDF web log
|
|
|
33
33
|
LOGS = {
|
|
34
34
|
'OPTION' : 0,
|
|
35
35
|
'AWSLOG' : PgLOG.PGLOG["TRANSFER"] + "/AWSera5log",
|
|
36
|
-
'WEBLOG' : PgLOG.PGLOG["
|
|
37
|
-
'OSDFLOG' : PgLOG.PGLOG["
|
|
36
|
+
'WEBLOG' : PgLOG.PGLOG["GDEXWORK"] + "/logs/gridftp",
|
|
37
|
+
'OSDFLOG' : PgLOG.PGLOG["GDEXWORK"] + "/zji/osdflogs",
|
|
38
38
|
'MGTLOG' : "/data/logs",
|
|
39
39
|
'TDSLOG' : "/data/logs/nginx",
|
|
40
40
|
'RDALOG' : PgLOG.PGLOG['LOGPATH'],
|
|
@@ -60,10 +60,10 @@ def main():
|
|
|
60
60
|
|
|
61
61
|
option = None
|
|
62
62
|
for arg in argv:
|
|
63
|
-
ms = re.match(r'^-([
|
|
63
|
+
ms = re.match(r'^-([abcdmnopstw])', arg)
|
|
64
64
|
if ms:
|
|
65
65
|
option = ms.group(1)
|
|
66
|
-
if option in '
|
|
66
|
+
if option in 'cmp': continue
|
|
67
67
|
if option == "b":
|
|
68
68
|
PgLOG.PGLOG['BCKGRND'] = 1
|
|
69
69
|
elif option == "d":
|
|
@@ -81,6 +81,8 @@ def main():
|
|
|
81
81
|
elif option == "n":
|
|
82
82
|
LOGS['CHKLOG'] = 0
|
|
83
83
|
option = None
|
|
84
|
+
elif option == 'c':
|
|
85
|
+
PgLOG.add_carbon_copy(arg, 1)
|
|
84
86
|
elif option == 'm':
|
|
85
87
|
smonth = arg
|
|
86
88
|
elif option == 'p':
|
|
@@ -125,6 +127,9 @@ def archive_web_log(smonth):
|
|
|
125
127
|
if op.exists(afile): PgFile.delete_local_file(afile)
|
|
126
128
|
|
|
127
129
|
logfiles = sorted(glob.glob("{}/access_log_gridftp??_{}??{}".format(logpath, mn, yr)))
|
|
130
|
+
if not logfiles:
|
|
131
|
+
PgLOG.pglog("{}: NO globus web log file found for {}-{} to archive".format(logpath, yr, mn), PgLOG.LGWNEM)
|
|
132
|
+
return
|
|
128
133
|
topt = '-cvf'
|
|
129
134
|
tcnt = 0
|
|
130
135
|
for logfile in logfiles:
|
|
@@ -164,6 +169,9 @@ def archive_osdf_log(smonth):
|
|
|
164
169
|
if op.exists(afile): PgFile.delete_local_file(afile)
|
|
165
170
|
|
|
166
171
|
logfiles = sorted(glob.glob("{}/{}-{}-??.log".format(logpath, yr, mn)))
|
|
172
|
+
if not logfiles:
|
|
173
|
+
PgLOG.pglog("{}: NO OSDF web log file found for {}-{} to archive".format(logpath, yr, mn), PgLOG.LGWNEM)
|
|
174
|
+
return
|
|
167
175
|
topt = '-cvf'
|
|
168
176
|
tcnt = 0
|
|
169
177
|
for logfile in logfiles:
|
|
@@ -177,7 +185,7 @@ def archive_osdf_log(smonth):
|
|
|
177
185
|
afile += '.gz'
|
|
178
186
|
PgFile.move_local_file(dfile, afile, PgLOG.LGWNEM)
|
|
179
187
|
s = 's' if tcnt > 1 else ''
|
|
180
|
-
PgLOG.pglog("{}: {}
|
|
188
|
+
PgLOG.pglog("{}: {} OSDF log{} tarred, gzipped and archived at {}".format(afile, tcnt, s, PgLOG.current_datetime()), PgLOG.LGWNEM)
|
|
181
189
|
|
|
182
190
|
#
|
|
183
191
|
# Archive AWS web log files to LOGS['DECSLOGS']
|
|
@@ -196,6 +204,9 @@ def archive_aws_log(smonth):
|
|
|
196
204
|
if op.exists(afile): PgFile.delete_local_file(afile)
|
|
197
205
|
|
|
198
206
|
lfile = "{}/{}".format(yr, mn)
|
|
207
|
+
if not op.exists("{}/{}".format(logpath, lfile)):
|
|
208
|
+
PgLOG.pglog("{}/{}: NO AWS web log directory found to archive".format(logpath, lfile), PgLOG.LGWNEM)
|
|
209
|
+
return
|
|
199
210
|
tcmd = "tar -cvf {} -C {} {}".format(afile, logpath, lfile)
|
|
200
211
|
PgLOG.pgsystem(tcmd, PgLOG.LGWNEM, 5)
|
|
201
212
|
|
|
@@ -221,6 +232,9 @@ def archive_tds_log(smonth):
|
|
|
221
232
|
if op.exists(afile): PgFile.delete_local_file(afile)
|
|
222
233
|
|
|
223
234
|
logfiles = sorted(glob.glob("{}/{}-{}-??.access.log".format(logpath, yr, mn)))
|
|
235
|
+
if not logfiles:
|
|
236
|
+
PgLOG.pglog("{}: NO thredds log file found for {}-{} to archive".format(logpath, yr, mn), PgLOG.LGWNEM)
|
|
237
|
+
return
|
|
224
238
|
topt = '-cvf'
|
|
225
239
|
tcnt = 0
|
|
226
240
|
for logfile in logfiles:
|
|
@@ -257,6 +271,9 @@ def archive_dssdb_log():
|
|
|
257
271
|
|
|
258
272
|
# collect all the large log/err files
|
|
259
273
|
files = sorted(glob.glob("*.log") + glob.glob("*.err"))
|
|
274
|
+
if not files:
|
|
275
|
+
PgLOG.pglog("{}: NO dssdb log file found to archive".format(LOGS['RDALOG']), PgLOG.LGWNEM)
|
|
276
|
+
return
|
|
260
277
|
for file in files:
|
|
261
278
|
info = PgFile.check_local_file(file, 2)
|
|
262
279
|
if(not info or info['data_size'] < 10000): continue # skip log files small than 10KB
|
|
@@ -21,7 +21,7 @@ class LogArch(PgFile):
|
|
|
21
21
|
def __init__(self):
|
|
22
22
|
super().__init__()
|
|
23
23
|
# the defined options for archiving different logs
|
|
24
|
-
self.WLOG =
|
|
24
|
+
self.WLOG = 0x01 # archive web log
|
|
25
25
|
self.TLOG = 0x02 # archive tds log
|
|
26
26
|
self.DLOG = 0x04 # archive dssdb logs
|
|
27
27
|
self.SLOG = 0x08 # append dssdb sub batch logs
|
|
@@ -30,8 +30,8 @@ class LogArch(PgFile):
|
|
|
30
30
|
self.LOGS = {
|
|
31
31
|
'OPTION' : 0,
|
|
32
32
|
'AWSLOG' : self.PGLOG["TRANSFER"] + "/AWSera5log",
|
|
33
|
-
'WEBLOG' : self.PGLOG["
|
|
34
|
-
'OSDFLOG' : self.PGLOG["
|
|
33
|
+
'WEBLOG' : self.PGLOG["GDEXWORK"] + "/logs/gridftp",
|
|
34
|
+
'OSDFLOG' : self.PGLOG["GDEXWORK"] + "/zji/osdflogs",
|
|
35
35
|
'MGTLOG' : "/data/logs",
|
|
36
36
|
'TDSLOG' : "/data/logs/nginx",
|
|
37
37
|
'RDALOG' : self.PGLOG['LOGPATH'],
|
|
@@ -51,10 +51,10 @@ class LogArch(PgFile):
|
|
|
51
51
|
self.set_suid(self.PGLOG['EUID'])
|
|
52
52
|
option = None
|
|
53
53
|
for arg in argv:
|
|
54
|
-
ms = re.match(r'^-([
|
|
54
|
+
ms = re.match(r'^-([abcdmnopstw])', arg)
|
|
55
55
|
if ms:
|
|
56
56
|
option = ms.group(1)
|
|
57
|
-
if option in '
|
|
57
|
+
if option in 'cmp': continue
|
|
58
58
|
if option == "b":
|
|
59
59
|
self.PGLOG['BCKGRND'] = 1
|
|
60
60
|
elif option == "d":
|
|
@@ -72,6 +72,8 @@ class LogArch(PgFile):
|
|
|
72
72
|
elif option == "n":
|
|
73
73
|
self.LOGS['CHKLOG'] = 0
|
|
74
74
|
option = None
|
|
75
|
+
elif option == 'c':
|
|
76
|
+
self.add_carbon_copy(arg, 1)
|
|
75
77
|
elif option == 'm':
|
|
76
78
|
self.smonth = arg
|
|
77
79
|
elif option == 'p':
|
|
@@ -110,6 +112,9 @@ class LogArch(PgFile):
|
|
|
110
112
|
return
|
|
111
113
|
if op.exists(afile): self.delete_local_file(afile)
|
|
112
114
|
logfiles = sorted(glob.glob("{}/access_log_gridftp??_{}??{}".format(logpath, mn, yr)))
|
|
115
|
+
if not logfiles:
|
|
116
|
+
self.pglog("{}: NO globus web log file found for {}-{} to archive".format(logpath, yr, mn), self.LGWNEM)
|
|
117
|
+
return
|
|
113
118
|
topt = '-cvf'
|
|
114
119
|
tcnt = 0
|
|
115
120
|
for logfile in logfiles:
|
|
@@ -122,7 +127,7 @@ class LogArch(PgFile):
|
|
|
122
127
|
lfile = op.basename(logfile)
|
|
123
128
|
tcmd = "tar {} {} -C {} {}".format(topt, afile, logpath, lfile)
|
|
124
129
|
tcnt += self.pgsystem(tcmd, self.LGWNEM, 5)
|
|
125
|
-
topt = '-uvf'
|
|
130
|
+
topt = '-uvf'
|
|
126
131
|
if tcnt > 0:
|
|
127
132
|
self.pgsystem("gzip " + afile, self.LGWNEM, 5)
|
|
128
133
|
afile += '.gz'
|
|
@@ -142,6 +147,9 @@ class LogArch(PgFile):
|
|
|
142
147
|
return
|
|
143
148
|
if op.exists(afile): self.delete_local_file(afile)
|
|
144
149
|
logfiles = sorted(glob.glob("{}/{}-{}-??.log".format(logpath, yr, mn)))
|
|
150
|
+
if not logfiles:
|
|
151
|
+
self.pglog("{}: NO OSDF web log file found for {}-{} to archive".format(logpath, yr, mn), self.LGWNEM)
|
|
152
|
+
return
|
|
145
153
|
topt = '-cvf'
|
|
146
154
|
tcnt = 0
|
|
147
155
|
for logfile in logfiles:
|
|
@@ -154,7 +162,7 @@ class LogArch(PgFile):
|
|
|
154
162
|
afile += '.gz'
|
|
155
163
|
self.move_local_file(dfile, afile, self.LGWNEM)
|
|
156
164
|
s = 's' if tcnt > 1 else ''
|
|
157
|
-
self.pglog("{}: {}
|
|
165
|
+
self.pglog("{}: {} OSDF log{} tarred, gzipped and archived at {}".format(afile, tcnt, s, self.current_datetime()), self.LGWNEM)
|
|
158
166
|
|
|
159
167
|
# Archive AWS web log files to self.LOGS['DECSLOGS']
|
|
160
168
|
def archive_aws_log(self):
|
|
@@ -168,6 +176,9 @@ class LogArch(PgFile):
|
|
|
168
176
|
return
|
|
169
177
|
if op.exists(afile): self.delete_local_file(afile)
|
|
170
178
|
lfile = "{}/{}".format(yr, mn)
|
|
179
|
+
if not op.exists("{}/{}".format(logpath, lfile)):
|
|
180
|
+
self.pglog("{}/{}: NO AWS web log directory found to archive".format(logpath, lfile), self.LGWNEM)
|
|
181
|
+
return
|
|
171
182
|
tcmd = "tar -cvf {} -C {} {}".format(afile, logpath, lfile)
|
|
172
183
|
self.pgsystem(tcmd, self.LGWNEM, 5)
|
|
173
184
|
self.pgsystem("gzip " + afile, self.LGWNEM, 5)
|
|
@@ -187,6 +198,9 @@ class LogArch(PgFile):
|
|
|
187
198
|
return
|
|
188
199
|
if op.exists(afile): self.delete_local_file(afile)
|
|
189
200
|
logfiles = sorted(glob.glob("{}/{}-{}-??.access.log".format(logpath, yr, mn)))
|
|
201
|
+
if not logfiles:
|
|
202
|
+
self.pglog("{}: NO thredds log file found for {}-{} to archive".format(logpath, yr, mn), self.LGWNEM)
|
|
203
|
+
return
|
|
190
204
|
topt = '-cvf'
|
|
191
205
|
tcnt = 0
|
|
192
206
|
for logfile in logfiles:
|
|
@@ -217,6 +231,9 @@ class LogArch(PgFile):
|
|
|
217
231
|
self.change_local_directory(self.LOGS['RDALOG'], self.LWEMEX)
|
|
218
232
|
# collect all the large log/err files
|
|
219
233
|
files = sorted(glob.glob("*.log") + glob.glob("*.err"))
|
|
234
|
+
if not files:
|
|
235
|
+
self.pglog("{}: NO dssdb log file found to archive".format(self.LOGS['RDALOG']), self.LGWNEM)
|
|
236
|
+
return
|
|
220
237
|
for file in files:
|
|
221
238
|
info = self.check_local_file(file, 2)
|
|
222
239
|
if(not info or info['data_size'] < 10000): continue # skip log files small than 10KB
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
detected and skipped (unless -n is given).
|
|
6
6
|
|
|
7
7
|
USAGE:
|
|
8
|
-
logarch [-b] [-n] [-s] [-p LogPath] [-m YearMonth]
|
|
8
|
+
logarch [-b] [-n] [-s] [-c CcAddress] [-p LogPath] [-m YearMonth]
|
|
9
9
|
(-a | -d | -o | -t | -w) [more archive-type flags]
|
|
10
10
|
|
|
11
11
|
ARCHIVE TYPES (at least one required):
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
-m YearMonth
|
|
22
22
|
Archive logs for the given YYYY-MM (e.g. 2024-01) only.
|
|
23
23
|
|
|
24
|
+
-c CcAddress
|
|
25
|
+
Carbon-copy the email notice to one or more additional specialists
|
|
26
|
+
(comma/space-separated). May be given more than once.
|
|
27
|
+
|
|
24
28
|
-p LogPath
|
|
25
29
|
Use LogPath instead of the default log directory.
|
|
26
30
|
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_allusage.py
RENAMED
|
@@ -247,7 +247,7 @@ def check_enough_options():
|
|
|
247
247
|
if 'z' not in params or sn in EXPAND: continue
|
|
248
248
|
fld = FLDS[sn]
|
|
249
249
|
if fld[6] != 'G': continue
|
|
250
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
250
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
251
251
|
|
|
252
252
|
if 'E' in params or 'I' in params:
|
|
253
253
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_awsusage.py
RENAMED
|
@@ -224,7 +224,7 @@ def check_enough_options():
|
|
|
224
224
|
if 'z' not in params or sn in EXPAND: continue
|
|
225
225
|
fld = FLDS[sn]
|
|
226
226
|
if fld[6] != 'G': continue
|
|
227
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
227
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
228
228
|
|
|
229
229
|
if 'E' in params or 'I' in params:
|
|
230
230
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_checkusage.py
RENAMED
|
@@ -23,7 +23,7 @@ from rda_python_common import PgDBI
|
|
|
23
23
|
from . import PgView
|
|
24
24
|
|
|
25
25
|
VUSG = {
|
|
26
|
-
'SNMS' : "
|
|
26
|
+
'SNMS' : "ABCDEFGHIJKLMNPQRSTUVWYZ", # all available short field names in FLDS
|
|
27
27
|
'OPTS' : 'aABcCdDhHilLmnOqrsStTwyz', # all available options, used for params
|
|
28
28
|
'NOPT' : 'abwz', # stand alone option without inputs
|
|
29
29
|
'ACND' : 'cdhilLmnsSty', # available array condition options
|
|
@@ -120,7 +120,7 @@ params = {}
|
|
|
120
120
|
# related to a field name if it is not in keys SNS
|
|
121
121
|
SNS = {
|
|
122
122
|
'b' : 'L', 'B' : 'L', 'c' : 'C', 'd' : 'D', 'D' : 'D', 'h' : 'H', 'i' : 'I', 'm' : 'M', 'n' : 'N',
|
|
123
|
-
'q' : 'Q', 'r' : 'R', '
|
|
123
|
+
'q' : 'Q', 'r' : 'R', 's' : 'W', 'S' : 'S', 't' : 'T', 'T' : 'T', 'y' : 'Y'
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
tablenames = fieldnames = condition = ''
|
|
@@ -203,7 +203,7 @@ def check_enough_options():
|
|
|
203
203
|
for sn in flds:
|
|
204
204
|
if sn == 'X': continue # do not process INDEX field
|
|
205
205
|
if VUSG['SNMS'].find(sn) == -1:
|
|
206
|
-
PgLOG.pglog("{}: Field
|
|
206
|
+
PgLOG.pglog("{}: Field {} must be in short field names: {}X".format(pgname, sn, VUSG['SNMS']), PgLOG.LGWNEX)
|
|
207
207
|
|
|
208
208
|
if 'z' not in params or sn in EXPAND: continue
|
|
209
209
|
fld = FLDS[sn]
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_codusage.py
RENAMED
|
@@ -225,7 +225,7 @@ def check_enough_options():
|
|
|
225
225
|
if 'z' not in params or sn in EXPAND: continue
|
|
226
226
|
fld = FLDS[sn]
|
|
227
227
|
if fld[6] != 'G': continue
|
|
228
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
228
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
229
229
|
|
|
230
230
|
if 'E' in params or 'I' in params:
|
|
231
231
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_ordusage.py
RENAMED
|
@@ -240,7 +240,7 @@ def check_enough_options():
|
|
|
240
240
|
if 'z' not in params or sn in EXPAND: continue
|
|
241
241
|
fld = FLDS[sn]
|
|
242
242
|
if fld[6] != 'G': continue
|
|
243
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
243
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
244
244
|
|
|
245
245
|
if 'E' in params:
|
|
246
246
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_osdfusage.py
RENAMED
|
@@ -86,7 +86,7 @@ EXPAND = {
|
|
|
86
86
|
'T' : ["DSID", "StT", "dataset.dsid", "dataset"],
|
|
87
87
|
'P' : ["DSID", "StT", "specialist", "dsowner"],
|
|
88
88
|
|
|
89
|
-
'W' : ["METHOD", "
|
|
89
|
+
'W' : ["METHOD", "M", "method", "osdfusage"]
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
# valid options for params, a hash array of command line parameters
|
|
@@ -224,7 +224,7 @@ def check_enough_options():
|
|
|
224
224
|
if 'z' not in params or sn in EXPAND: continue
|
|
225
225
|
fld = FLDS[sn]
|
|
226
226
|
if fld[6] != 'G': continue
|
|
227
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
227
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
228
228
|
|
|
229
229
|
if 'E' in params or 'I' in params:
|
|
230
230
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_rqstusage.py
RENAMED
|
@@ -248,7 +248,7 @@ def check_enough_options():
|
|
|
248
248
|
if 'z' not in params or sn in EXPAND: continue
|
|
249
249
|
fld = FLDS[sn]
|
|
250
250
|
if fld[6] != 'G': continue
|
|
251
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
251
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
252
252
|
|
|
253
253
|
if 'E' in params or 'I' in params:
|
|
254
254
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_tdsusage.py
RENAMED
|
@@ -229,7 +229,7 @@ def check_enough_options():
|
|
|
229
229
|
if 'z' not in params or sn in EXPAND: continue
|
|
230
230
|
fld = FLDS[sn]
|
|
231
231
|
if fld[6] != 'G': continue
|
|
232
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
232
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
233
233
|
|
|
234
234
|
if 'E' in params or 'I' in params:
|
|
235
235
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_webfile.py
RENAMED
|
@@ -22,15 +22,15 @@ from rda_python_common import PgDBI
|
|
|
22
22
|
from . import PgView
|
|
23
23
|
|
|
24
24
|
FILE = {
|
|
25
|
-
'SNMS' : "
|
|
26
|
-
'OPTS' : '
|
|
25
|
+
'SNMS' : "ABCDEFGHIJKLMNOPQRSTUWYZ", # all available short field names in FLDS
|
|
26
|
+
'OPTS' : 'AabCdDefFgGHijJlLmMNoOprsStTuUWwyYzZ', # all available options, used for params
|
|
27
27
|
'NOPT' : 'abjJw', # stand alone option without inputs
|
|
28
|
-
'ACND' : '
|
|
28
|
+
'ACND' : 'defgGilmMopStuWyYz', # available array condition options
|
|
29
29
|
'RCND' : 'DFNrsTZ', # available range condition options
|
|
30
|
-
'CNDS' : '
|
|
30
|
+
'CNDS' : 'adDefFgGilmMNoprstTuWyYzZ', # condition options, ACND, RCND and 'a'
|
|
31
31
|
'ECND' : 'mMyY', # condition options need evaluating
|
|
32
|
-
'SFLD' : '
|
|
33
|
-
'UFLD' : '
|
|
32
|
+
'SFLD' : 'DEFILNOPQTUWZ', # string fields, to be quoted in condition
|
|
33
|
+
'UFLD' : 'ILOPW', # string fields must be in upper case
|
|
34
34
|
'LFLD' : 'EQTU' # string fields must be in lower case
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -91,8 +91,7 @@ FLDS = {
|
|
|
91
91
|
# L -- column delimiter for output
|
|
92
92
|
# m -- array of specified months of file last written
|
|
93
93
|
# M -- array of specified months of file created
|
|
94
|
-
#
|
|
95
|
-
# D -- dates range, datasets created between, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
94
|
+
# N -- dataset created dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
96
95
|
# o -- array of specified file status
|
|
97
96
|
# O -- a string of short field names for sorting on
|
|
98
97
|
# p -- array of web file types, Data, Document, and etc.
|
|
@@ -104,6 +103,7 @@ FLDS = {
|
|
|
104
103
|
# u -- array of specified specialist user names
|
|
105
104
|
# U -- use given unit for file or data sizes
|
|
106
105
|
# w -- generate view without totals
|
|
106
|
+
# W -- array of specified dataset types
|
|
107
107
|
# y -- array of specified years of file last written
|
|
108
108
|
# Y -- array of specified years of file created
|
|
109
109
|
# z -- array of specified dates when files created
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/view_webusage.py
RENAMED
|
@@ -270,7 +270,7 @@ def check_enough_options():
|
|
|
270
270
|
if 'z' not in params or sn in EXPAND: continue
|
|
271
271
|
fld = FLDS[sn]
|
|
272
272
|
if fld[6] != 'G': continue
|
|
273
|
-
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
273
|
+
PgLOG.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(pgname, sn, fld[0]), PgLOG.LGWNEX)
|
|
274
274
|
|
|
275
275
|
if 'E' in params or 'I' in params:
|
|
276
276
|
if 'z' in params:
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewallusage.py
RENAMED
|
@@ -230,7 +230,7 @@ class ViewALLUsage(PgView):
|
|
|
230
230
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
231
231
|
fld = self.FLDS[sn]
|
|
232
232
|
if fld[6] != 'G': continue
|
|
233
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
233
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
234
234
|
if 'E' in self.params or 'I' in self.params:
|
|
235
235
|
if 'z' in self.params:
|
|
236
236
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewawsusage.py
RENAMED
|
@@ -202,7 +202,7 @@ class ViewAWSUsage(PgView):
|
|
|
202
202
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
203
203
|
fld = self.FLDS[sn]
|
|
204
204
|
if fld[6] != 'G': continue
|
|
205
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
205
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
206
206
|
if 'E' in self.params or 'I' in self.params:
|
|
207
207
|
if 'z' in self.params:
|
|
208
208
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcheckusage.py
RENAMED
|
@@ -22,7 +22,7 @@ class ViewCheckUsage(PgView):
|
|
|
22
22
|
def __init__(self):
|
|
23
23
|
super().__init__()
|
|
24
24
|
self.VUSG = {
|
|
25
|
-
'SNMS' : "
|
|
25
|
+
'SNMS' : "ABCDEFGHIJKLMNPQRSTUVWYZ", # all available short field names in FLDS
|
|
26
26
|
'OPTS' : 'aABcCdDhHilLmnOqrsStTwyz', # all available options, used for params
|
|
27
27
|
'NOPT' : 'abwz', # stand alone option without inputs
|
|
28
28
|
'ACND' : 'cdhilLmnsSty', # available array condition options
|
|
@@ -115,7 +115,7 @@ class ViewCheckUsage(PgView):
|
|
|
115
115
|
# related to a field name if it is not in keys SNS
|
|
116
116
|
self.SNS = {
|
|
117
117
|
'b' : 'L', 'B' : 'L', 'c' : 'C', 'd' : 'D', 'D' : 'D', 'h' : 'H', 'i' : 'I', 'm' : 'M', 'n' : 'N',
|
|
118
|
-
'q' : 'Q', 'r' : 'R', '
|
|
118
|
+
'q' : 'Q', 'r' : 'R', 's' : 'W', 'S' : 'S', 't' : 'T', 'T' : 'T', 'y' : 'Y'
|
|
119
119
|
}
|
|
120
120
|
self.tablenames = self.fieldnames = self.condition = ''
|
|
121
121
|
self.sfields = []
|
|
@@ -187,7 +187,7 @@ class ViewCheckUsage(PgView):
|
|
|
187
187
|
for sn in flds:
|
|
188
188
|
if sn == 'X': continue # do not process INDEX field
|
|
189
189
|
if self.VUSG['SNMS'].find(sn) == -1:
|
|
190
|
-
self.pglog("{}: Field
|
|
190
|
+
self.pglog("{}: Field {} must be in short field names: {}X".format(self.pgname, sn, self.VUSG['SNMS']), self.LGWNEX)
|
|
191
191
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
192
192
|
fld = self.FLDS[sn]
|
|
193
193
|
if fld[6] != 'G': continue
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcodusage.py
RENAMED
|
@@ -204,7 +204,7 @@ class ViewCODUsage(PgView):
|
|
|
204
204
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
205
205
|
fld = self.FLDS[sn]
|
|
206
206
|
if fld[6] != 'G': continue
|
|
207
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
207
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
208
208
|
if 'E' in self.params or 'I' in self.params:
|
|
209
209
|
if 'z' in self.params:
|
|
210
210
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewordusage.py
RENAMED
|
@@ -217,7 +217,7 @@ class ViewORDUsage(PgView):
|
|
|
217
217
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
218
218
|
fld = self.FLDS[sn]
|
|
219
219
|
if fld[6] != 'G': continue
|
|
220
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
220
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
221
221
|
if 'E' in self.params:
|
|
222
222
|
if 'z' in self.params:
|
|
223
223
|
self.pglog(self.pgname + ": option -z and -E can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewosdfusage.py
RENAMED
|
@@ -80,7 +80,7 @@ class ViewOSDFUsage(PgView):
|
|
|
80
80
|
'R' : ["DSID", "StT", "search.datasets.title", "search.datasets"],
|
|
81
81
|
'T' : ["DSID", "StT", "dataset.dsid", "dataset"],
|
|
82
82
|
'P' : ["DSID", "StT", "specialist", "dsowner"],
|
|
83
|
-
'W' : ["METHOD", "
|
|
83
|
+
'W' : ["METHOD", "M", "method", "osdfusage"]
|
|
84
84
|
}
|
|
85
85
|
# valid options for params, a hash array of command line parameters
|
|
86
86
|
# a -- 1 to view all usage info available
|
|
@@ -202,7 +202,7 @@ class ViewOSDFUsage(PgView):
|
|
|
202
202
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
203
203
|
fld = self.FLDS[sn]
|
|
204
204
|
if fld[6] != 'G': continue
|
|
205
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
205
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
206
206
|
if 'E' in self.params or 'I' in self.params:
|
|
207
207
|
if 'z' in self.params:
|
|
208
208
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewrqstusage.py
RENAMED
|
@@ -224,7 +224,7 @@ class ViewRQSTUsage(PgView):
|
|
|
224
224
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
225
225
|
fld = self.FLDS[sn]
|
|
226
226
|
if fld[6] != 'G': continue
|
|
227
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
227
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
228
228
|
if 'E' in self.params or 'I' in self.params:
|
|
229
229
|
if 'z' in self.params:
|
|
230
230
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewtdsusage.py
RENAMED
|
@@ -207,7 +207,7 @@ class ViewTDSUsage(PgView):
|
|
|
207
207
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
208
208
|
fld = self.FLDS[sn]
|
|
209
209
|
if fld[6] != 'G': continue
|
|
210
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
210
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
211
211
|
if 'E' in self.params or 'I' in self.params:
|
|
212
212
|
if 'z' in self.params:
|
|
213
213
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
|
@@ -21,15 +21,15 @@ class ViewWEBFile(PgView):
|
|
|
21
21
|
def __init__(self):
|
|
22
22
|
super().__init__()
|
|
23
23
|
self.FILE = {
|
|
24
|
-
'SNMS' : "
|
|
25
|
-
'OPTS' : '
|
|
24
|
+
'SNMS' : "ABCDEFGHIJKLMNOPQRSTUWYZ", # all available short field names in FLDS
|
|
25
|
+
'OPTS' : 'AabCdDefFgGHijJlLmMNoOprsStTuUWwyYzZ', # all available options, used for params
|
|
26
26
|
'NOPT' : 'abjJw', # stand alone option without inputs
|
|
27
|
-
'ACND' : '
|
|
27
|
+
'ACND' : 'defgGilmMopStuWyYz', # available array condition options
|
|
28
28
|
'RCND' : 'DFNrsTZ', # available range condition options
|
|
29
|
-
'CNDS' : '
|
|
29
|
+
'CNDS' : 'adDefFgGilmMNoprstTuWyYzZ', # condition options, ACND, RCND and 'a'
|
|
30
30
|
'ECND' : 'mMyY', # condition options need evaluating
|
|
31
|
-
'SFLD' : '
|
|
32
|
-
'UFLD' : '
|
|
31
|
+
'SFLD' : 'DEFILNOPQTUWZ', # string fields, to be quoted in condition
|
|
32
|
+
'UFLD' : 'ILOPW', # string fields must be in upper case
|
|
33
33
|
'LFLD' : 'EQTU' # string fields must be in lower case
|
|
34
34
|
}
|
|
35
35
|
# keys FLDS - short field names
|
|
@@ -88,8 +88,7 @@ class ViewWEBFile(PgView):
|
|
|
88
88
|
# L -- column delimiter for output
|
|
89
89
|
# m -- array of specified months of file last written
|
|
90
90
|
# M -- array of specified months of file created
|
|
91
|
-
#
|
|
92
|
-
# D -- dates range, datasets created between, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
91
|
+
# N -- dataset created dates range, array of 1 or 2 dates in format of YYYY-MM-DD
|
|
93
92
|
# o -- array of specified file status
|
|
94
93
|
# O -- a string of short field names for sorting on
|
|
95
94
|
# p -- array of web file types, Data, Document, and etc.
|
|
@@ -101,6 +100,7 @@ class ViewWEBFile(PgView):
|
|
|
101
100
|
# u -- array of specified specialist user names
|
|
102
101
|
# U -- use given unit for file or data sizes
|
|
103
102
|
# w -- generate view without totals
|
|
103
|
+
# W -- array of specified dataset types
|
|
104
104
|
# y -- array of specified years of file last written
|
|
105
105
|
# Y -- array of specified years of file created
|
|
106
106
|
# z -- array of specified dates when files created
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebfile.usg
RENAMED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
The '-C' flag may be omitted if ColumnNames is the first argument.
|
|
18
18
|
|
|
19
19
|
2. At least one condition option must be given:
|
|
20
|
-
-a -d -D -e -f -F -g -G -i -l -m -M -
|
|
21
|
-
-u -
|
|
20
|
+
-a -d -D -e -f -F -g -G -i -l -m -M -N -o -p -r -s -t -T
|
|
21
|
+
-u -W -y -Y -z -Z
|
|
22
22
|
|
|
23
23
|
3. Negation: for any condition option except -a, prepend '!' between
|
|
24
24
|
the flag and value to invert the filter, e.g. '-o ! DSS'.
|
|
25
25
|
|
|
26
26
|
4. Wildcards: condition options that take strings (-e, -f, -G, -i, -l,
|
|
27
|
-
-o, -t, -u
|
|
27
|
+
-o, -t, -u) accept SQL wildcards '%' (any chars) and '_' (one
|
|
28
28
|
char).
|
|
29
29
|
|
|
30
30
|
5. By default the output is paginated with a header, footer, and
|
|
@@ -46,35 +46,36 @@
|
|
|
46
46
|
Column letters:
|
|
47
47
|
|
|
48
48
|
Group Columns:
|
|
49
|
-
A - CYEAR - year the file was created
|
|
50
49
|
D - DATEWRITE - date the file was last written
|
|
51
50
|
E - EMAIL - email of file-written user
|
|
52
51
|
F - FILENAME - WEB data file name
|
|
53
52
|
G - PRODUCT - product (top group) information
|
|
54
53
|
H - CMONTH - month the file was created
|
|
55
54
|
I - FIRSTNAME - first name of file-written user
|
|
56
|
-
K -
|
|
55
|
+
K - CYEAR - year the file was created
|
|
57
56
|
L - LASTNAME - last name of file-written user
|
|
58
57
|
M - WMONTH - month the file was last written
|
|
59
|
-
N -
|
|
58
|
+
N - DSCREATED - date the dataset was created
|
|
60
59
|
O - STAT - file status: Public or Internal
|
|
61
60
|
P - TYPE - file type: Data, Software, etc.
|
|
62
|
-
Q -
|
|
61
|
+
Q - DSOWNER - specialist who owns the dataset
|
|
63
62
|
R* - DSTITLE - dataset title
|
|
64
63
|
S - FILESIZE - individual file size (bytes)
|
|
65
64
|
T - DATASET - dataset name
|
|
66
|
-
U -
|
|
67
|
-
|
|
68
|
-
W - DSTYPE - dataset type flag: P, H, I, or W
|
|
65
|
+
U - SPECIALIST - login name of file-written user
|
|
66
|
+
W - DSTYPE - dataset type flag: D, H, I, P, or W
|
|
69
67
|
Y - WYEAR - year the file was last written
|
|
70
68
|
Z - DATECREATE - date the file was created
|
|
71
69
|
|
|
72
70
|
(*) = column may be displayed with zero usages when -z is used.
|
|
73
71
|
|
|
74
72
|
Summary Columns:
|
|
75
|
-
B -
|
|
76
|
-
|
|
77
|
-
|
|
73
|
+
B - MBYTEDATA - data size (MB) by the group
|
|
74
|
+
|
|
75
|
+
Count Columns:
|
|
76
|
+
A - DSCOUNT - number of distinct file names in the group
|
|
77
|
+
C - #UNIQSPLST - number of distinct specialists in the group
|
|
78
|
+
J - #UNIQFILE - number of distinct files in the group
|
|
78
79
|
|
|
79
80
|
Index Column:
|
|
80
81
|
X - INDEX - 1-based row index (use as the first column)
|
|
@@ -97,7 +98,7 @@
|
|
|
97
98
|
-l LastNameList Users with these last names.
|
|
98
99
|
-m MonthList Last written in these months (YYYY-MM).
|
|
99
100
|
-M MonthList Created in these months (YYYY-MM).
|
|
100
|
-
-
|
|
101
|
+
-N StartDate [EndDate] Datasets created between two dates.
|
|
101
102
|
-o FileStatus File status: P (Public) or I (Internal).
|
|
102
103
|
-p TypeList File types: D (Data), I (Internal Data),
|
|
103
104
|
O (Document), S (Software).
|
|
@@ -108,9 +109,7 @@
|
|
|
108
109
|
e.g. '-T d540000 d550009'.
|
|
109
110
|
-u UserNameList Last written by users with these
|
|
110
111
|
login names.
|
|
111
|
-
-
|
|
112
|
-
divisions.
|
|
113
|
-
-W DatasetTypes Dataset type flag: P, H, I, or W.
|
|
112
|
+
-W DatasetTypes Dataset type flag: D, H, I, P, or W.
|
|
114
113
|
-y YearList Last written in these years (YYYY).
|
|
115
114
|
-Y YearList Created in these years (YYYY).
|
|
116
115
|
-z DateList Created on these dates.
|
|
@@ -129,8 +128,8 @@
|
|
|
129
128
|
|
|
130
129
|
EXAMPLES:
|
|
131
130
|
|
|
132
|
-
View files last written in 2004 with columns INDEX,
|
|
133
|
-
#
|
|
131
|
+
View files last written in 2004 with columns INDEX, SPECIALIST, STAT,
|
|
132
|
+
#UNIQFILE, MBYTEDATA; sort by STAT ascending and MBYTEDATA descending:
|
|
134
133
|
|
|
135
134
|
viewwebfile XUOJB -y 2004 -O Ob
|
|
136
135
|
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebusage.py
RENAMED
|
@@ -247,7 +247,7 @@ class ViewWEBUsage(PgView):
|
|
|
247
247
|
if 'z' not in self.params or sn in self.EXPAND: continue
|
|
248
248
|
fld = self.FLDS[sn]
|
|
249
249
|
if fld[6] != 'G': continue
|
|
250
|
-
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".
|
|
250
|
+
self.pglog("{}: cannot show zero usage for unexpandable field {} - {}".format(self.pgname, sn, fld[0]), self.LGWNEX)
|
|
251
251
|
if 'E' in self.params or 'I' in self.params:
|
|
252
252
|
if 'z' in self.params:
|
|
253
253
|
self.pglog(self.pgname + ": option -z and -E/-I can not be present at the same time", self.LGWNEX)
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/SOURCES.txt
RENAMED
|
@@ -42,6 +42,7 @@ src/rda_python_metrics/filltdsusage.usg
|
|
|
42
42
|
src/rda_python_metrics/filluser.py
|
|
43
43
|
src/rda_python_metrics/filluser.usg
|
|
44
44
|
src/rda_python_metrics/fillzenodousage.py
|
|
45
|
+
src/rda_python_metrics/fillzenodousage.usg
|
|
45
46
|
src/rda_python_metrics/log_arch.py
|
|
46
47
|
src/rda_python_metrics/logarch.py
|
|
47
48
|
src/rda_python_metrics/logarch.usg
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_awsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_cdgusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_codusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_country.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_endtime.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_globususage.py
RENAMED
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_osdfusage.py
RENAMED
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fill_tdsusage.py
RENAMED
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillawsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcdgusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcdgusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillcodusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillgdexusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillgdexusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillglobususage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillglobususage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filloneorder.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillosdfusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillosdfusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filltdsusage.py
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/filltdsusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/fillzenodousage.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewallusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewawsusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcheckusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewcodusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewordusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewosdfusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewrqstusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewtdsusage.usg
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics/viewwebusage.usg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/requires.txt
RENAMED
|
File without changes
|
{rda_python_metrics-3.0.2 → rda_python_metrics-3.0.3}/src/rda_python_metrics.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|