Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
a647a06a
Commit
a647a06a
authored
7 years ago
by
Megan Henning
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite general class description
parent
f64f9166
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/handlers/reporthandler.py
+7
-15
7 additions, 15 deletions
api/handlers/reporthandler.py
with
7 additions
and
15 deletions
api/handlers/reporthandler.py
+
7
−
15
View file @
a647a06a
...
...
@@ -483,26 +483,24 @@ class AccessLogReport(Report):
class
UsageReport
(
Report
):
"""
Report of the last <limit> logs in the access log
.
Creates a usage report, aggregated by month or project
.
Specify a uid to only return logs for a specific user.
Specify a date range to only return logs in that range.
Specify a date range to only return stats for that range.
Report includes:
-
action completed
-
user that took act
ion
-
information about the session/project/group in which the action took place
-
count of gears executed (jobs completed successfully)
-
count of sess
ion
s
-
aggregation of file size in megabytes
"""
def
__init__
(
self
,
params
):
"""
Initialize a
n Access Log
Report
Initialize a
Usage
Report
Possible keys in :params:
:start_date: ISO formatted timestamp
:end_date: ISO formatted timestamp
:uid: user id of the target user
:limit: number of records to return
:type: <
'
project
'
|
'
month
'
>, type of aggregation for results
"""
super
(
UsageReport
,
self
).
__init__
(
params
)
...
...
@@ -529,12 +527,6 @@ class UsageReport(Report):
self
.
first_month
=
start_date
if
start_date
else
None
self
.
last_month
=
end_date
if
end_date
else
None
# if not self.last_month:
# # PYTHON WHY
# # WHY DO YOU DO THIS TO ME
# self.last_month = dt.utcnow()
# self.last_month.replace(tzinfo=dateutil.tz.tzutc())
def
user_can_generate
(
self
,
uid
):
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment