54 Commits

Author SHA1 Message Date
Dirk Müller
730630f06f
Use f-strings where possible 2024-05-07 21:52:32 +02:00
81882680ff
Use old function to pass tests 2023-01-25 17:16:35 +01:00
Stephan Kulow
4900ef7d02 metrics.py: Fix E741 ('l' may look like 'I') 2023-01-02 19:44:28 +01:00
Stephan Kulow
aaab4af930 Target F401 - Unused imports 2022-02-18 18:29:27 +01:00
Stephan Kulow
f86579642b Target E501 - Line too long
https://www.flake8rules.com/rules/E501.html - but 79 characters is a
joke
2022-02-18 18:17:27 +01:00
Stephan Kulow
529d1dafae Target E302 - add two comment lines before class 2022-02-18 17:15:48 +01:00
Stephan Kulow
4e9c8eabbe Target E305 - Have two empty lines of a class 2022-02-18 17:11:46 +01:00
Stephan Kulow
579145b52c Target F841 - Remove unused variables 2022-02-18 17:01:38 +01:00
Stephan Kulow
0561e06cb1 Target E261 - two spaces before inline comment 2022-02-18 16:39:16 +01:00
Stephan Kulow
d6628beadf Target E125 - Continuation line with same indent
https://www.flake8rules.com/rules/E125.html
2022-02-18 15:52:53 +01:00
Witek Bedyk
4be4819544 Use string instead of byte stream for configparser 2020-12-01 17:18:29 +01:00
Witek Bedyk
abc39a2822 Rename ConfigParser to configparser
ConfigParser has been renamed to configparser in Python 3.
2020-12-01 16:19:35 +01:00
Witek Bedyk
8290b50aa4 Replace sys.maxint with sys.maxsize
sys.maxint has been removed in Python 3.1.

https://docs.python.org/3.1/whatsnew/3.0.html#integers
2020-12-01 15:18:29 +01:00
Stephan Kulow
010ffd8a51 Switch metrics to use python3
influxdb is no longer provided for python2
2020-03-10 12:02:22 +01:00
ec88760187 Fix Flake E241
One more step towards white space sanity. Next group is E20x.
2019-12-10 08:46:02 +01:00
Stephan Kulow
529c5623a6 Remove nonfree handling
Prepare NonFree as onlyadi project, so it can have its own staging workflow
2019-11-21 14:49:29 +01:00
Jimmy Berry
40b89d01c9 metrics: reduce request period to after 450000.
Works around ingest job crashing due to lack of memory. Hard to properly
workaround due to lack of sort API option from OBS.
2019-05-09 15:36:01 -05:00
Jimmy Berry
2df0813d36 metrics: sync config key with recent Leap changes. 2018-11-28 18:56:37 -06:00
Jimmy Berry
4c8ade1a93 flake8: utilize raw strings to avoid invalid escape character warnings. 2018-10-24 16:34:16 -05:00
Jimmy Berry
d7d3d55578 metrics: check for action/target instead of submit/target since removed.
In the wake of openSUSE/osc@f1c3156 removing the deprecated submit/target,
the special condition to limit Factory to "staging era" requests should be
updated to look for action/target.
2018-09-08 22:17:56 -05:00
Jimmy Berry
0b342a5856 metrics: remove workaround for OBS xpath bug during request search.
Now that the bug related to openSUSE/open-build-service#5571 has been fixed
the inverted behavior of exclude_target_projects no longer works. As such
the argument should be removed and only way to get the desired behavior
is to override include_request_from_project which includes request sourced
from specific project. For the purposes of metrics only interested in
requests targeting a specific project.
2018-09-08 22:15:43 -05:00
Jimmy Berry
fda67baa36 metrics: correct reference to Leap config defaults pattern. 2018-09-05 14:24:51 -05:00
Jimmy Berry
c47bb4c902 Utilize CacheManager for all existing caches. 2018-09-04 15:19:02 -05:00
Jimmy Berry
536e17cb79 osclib/stagingapi: rename dashboard_content_* methods to pseudometa_file_*.
No need to be confusing and use the deprecated dashboard name.
2018-08-17 23:19:24 -05:00
Jimmy Berry
24b15d6b0b Replace relevant 'dashboard' package references with pseudometa lookup.
Skipping some of the broader once which have no tangible impact, but are
expensive to change.
2018-08-17 23:18:32 -05:00
Jimmy Berry
760ddf39e6 osclib/conf: decouple from StagingAPI and always fetch remote config.
As the remote config is no longer optional for SLE and is utilized by
openSUSE to the point were it is dangerous not to load the remote config
it should be required. Currently only certain users call apply_remote()
while this will make it built-in during construction and thus makes the
usage consistent and no longer require StagingAPI.
2018-08-16 21:53:40 -05:00
Jimmy Berry
600a486745 Utilize ET.fromstringlist() intead of joining strings. 2018-08-16 00:26:53 -05:00
Jimmy Berry
bc03a99e46 metrics: thankfully we lived past the days of assembly variable name limits.
Replaces commit 437f46a4cb156d44baf9f2c18a4d702240936836.
2018-06-20 15:23:26 -05:00
Jimmy Berry
ed23a53196 metrics: ingest_dashboard(): replace max_revision duplicate variable nonsense
Replaces commit 437f46a4cb156d44baf9f2c18a4d702240936836.
2018-06-20 15:21:52 -05:00
Jimmy Berry
adaeac7714 Revert "Output Attribute metrics (not well tested)"
This reverts commit 3fa61c8b8780b8de14f821fd0768bdd0b82ce6da.

Remove this garbage from repository as it is not a toilet. This creates
corrupt records and prevents deployment to metrics.o.o.
2018-06-20 15:16:33 -05:00
Stephan Kulow
3fa61c8b87 Output Attribute metrics (not well tested) 2018-06-18 17:28:23 +02:00
Stephan Kulow
437f46a4cb Catch 404 in metrics
SP1 has no dashboard
2018-06-18 16:29:27 +02:00
Jimmy Berry
07599beca2 metrics: drop release schedule before writing.
After change from dropping entire database to individual measurements this
was overlooked and instead new points are simply written each time which
results in duplicates.
2018-05-18 14:20:26 -05:00
Jimmy Berry
abd03b39ea
Merge pull request #1506 from jberry-suse/metrics-config-missing
metrics: ingest_dashboard_config: initialize seen with last record keys.
2018-04-25 22:00:15 -05:00
Jimmy Berry
1677557fae metrics: ingest_dashboard_config: rename seen to previous.
More accurately describes the new purpose.
2018-04-25 21:43:07 -05:00
Jimmy Berry
4a1eb1701b metrics: ingest_dashboard_config: initialize seen with last record keys. 2018-04-25 21:42:16 -05:00
Jimmy Berry
e3b66f63b2 metrics: ingest_dashboard_config: only fill missing values once. 2018-04-25 21:35:54 -05:00
Jimmy Berry
1268165f53 metrics: dashboard: drop dashboard measurement in favor of dashboard_revision. 2018-04-24 19:27:18 -05:00
Jimmy Berry
6e74ae62fd metrics: dashboard: include revisions graph. 2018-04-24 19:24:52 -05:00
Jimmy Berry
a45c3358df metrics: ingest relevant dashboard files and extract metrics. 2018-04-20 16:32:02 -05:00
Jimmy Berry
4ee96ae3d2 metrics: provide dashboard revision walking function and cache patterns. 2018-04-20 16:30:27 -05:00
Jimmy Berry
079eda3ba6 metrics: instead of wiping cache place ephemeral patterns behind flag.
This allows for non-ephemeral queries to be cached indeinitely in the
future (like source queries that include the revision). For development
one may use --heavy-cache to be able to quickly iterate.
2018-04-20 16:25:47 -05:00
Jimmy Berry
39ef75493d Change references to osc-plugin-factory to openSUSE-release-tools. 2018-03-16 14:58:27 -05:00
Jimmy Berry
1dd9b64480 metrics: do not drop entire database, but instead measurements.
This ensures that release data, which is ingest separately, is not wiped
out. Additionally, it is less destructive during update.
2018-03-09 17:16:49 -06:00
Jimmy Berry
da5bfafb42 metrics: provide release metrics ingestion and dashboard. 2018-03-09 00:34:01 -06:00
Jimmy Berry
76ac5d6b2e metrics: ingest_release_schedule(): disable for Tumbleweed until #1250. 2018-02-19 14:40:17 -06:00
Jimmy Berry
f0fee5ec8d metrics: update Leap config key to match osclib/conf post #1386. 2018-02-19 14:39:44 -06:00
Jimmy Berry
1eba364ef8 metrics: provide --wipe-cache option. 2018-01-10 20:11:46 -06:00
Jimmy Berry
26883b12d2 metrics: rework to store points as named tuple and write in batches.
Savings of around 400MB per 10,000 requests. Using a named tuple was the
original approach for this reason, but the influxdb interface requires
dict()s and it seemed silly to spend time converting them. Additionally,
influxdb client already does batching.

Unfortunately, with the amount of data processed for Factory that will
continue to grow this approach is necessary. The dict() final structures
are buffered up to ~1000 before being written and released. Another
benefit of the batching is that influxdb does not allocate memory for the
entire incoming batch.
2017-11-09 16:17:57 -06:00
Jimmy Berry
8a87becd55 metrics: rework request pagination to provide as generator.
This prevents the memory required to process to be enough to load all
parsed request element trees at once. Instead only one page of requests
is loaded at a time and the memory freed after processed. The end result
is the memory consumption reduced by just over 20% (current Factory drops
by around 2.5GB).
2017-11-09 16:17:25 -06:00