Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eduGAIN Connectivity Check
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
edugain
eduGAIN Connectivity Check
Commits
170d87dc
Commit
170d87dc
authored
9 months ago
by
Valentin Pocotilenco
Browse files
Options
Downloads
Patches
Plain Diff
refactored front and backend
parent
4d43bd44
Branches
refactor/web-statistics-removal
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
api.py
+6
-10
6 additions, 10 deletions
api.py
eccs_properties.py
+6
-0
6 additions, 0 deletions
eccs_properties.py
web/index.php
+0
-15
0 additions, 15 deletions
web/index.php
with
12 additions
and
25 deletions
api.py
+
6
−
10
View file @
170d87dc
...
@@ -434,13 +434,9 @@ class FedStats(Resource):
...
@@ -434,13 +434,9 @@ class FedStats(Resource):
# /api/webdata
# /api/webdata
class
WebData
(
Resource
):
class
WebData
(
Resource
):
def
get
(
self
):
def
get
(
self
):
file_path
=
f
"
{
e_p
.
ECCS_STATS_INPUT_DIR
}
/
eccs-uwsgi-req.log
"
# will this name be moved to properties definer file ?
file_path
=
f
"
{
e_p
.
ECCS_STATS_INPUT_DIR
}
/
{
e_p
.
ECCS_REQ_LOG
}
"
criteria
=
{}
criteria
=
{}
criteria
[
'
date_from
'
]
=
criteria
[
'
date_to
'
]
=
e_p
.
DAY
criteria
[
'
date_from
'
]
=
criteria
[
'
date_to
'
]
=
e_p
.
DAY
# TBM to config
eccsLogRotated
=
True
useParsedFile
=
False
in_data
=
request
.
args
in_data
=
request
.
args
if
(
'
dateFrom
'
in
in_data
and
isValidDate
(
in_data
[
'
dateFrom
'
])):
if
(
'
dateFrom
'
in
in_data
and
isValidDate
(
in_data
[
'
dateFrom
'
])):
...
@@ -471,15 +467,15 @@ class WebData(Resource):
...
@@ -471,15 +467,15 @@ class WebData(Resource):
results
=
{}
results
=
{}
cur_date
=
criteria
[
'
date_from
'
]
cur_date
=
criteria
[
'
date_from
'
]
if
e
ccsLogRotated
==
True
:
if
e
_p
.
ECCS_LOG_FILE_ROTATED
==
True
:
while
cur_date
<=
criteria
[
'
date_to
'
]:
while
cur_date
<=
criteria
[
'
date_to
'
]:
json_data
=
{}
json_data
=
{}
criteria
[
'
logfile_date
'
]
=
(
datetime
.
strptime
(
cur_date
,
'
%Y-%m-%d
'
)
+
timedelta
(
days
=
1
)).
strftime
(
'
%Y-%m-%d
'
)
criteria
[
'
logfile_date
'
]
=
(
datetime
.
strptime
(
cur_date
,
'
%Y-%m-%d
'
)
+
timedelta
(
days
=
1
)).
strftime
(
'
%Y-%m-%d
'
)
criteria
[
'
cur_date
'
]
=
cur_date
criteria
[
'
cur_date
'
]
=
cur_date
tmpDate
=
datetime
.
strptime
(
criteria
[
'
logfile_date
'
],
'
%Y-%m-%d
'
).
strftime
(
'
%Y%m%d
'
)
tmpDate
=
datetime
.
strptime
(
criteria
[
'
logfile_date
'
],
'
%Y-%m-%d
'
).
strftime
(
'
%Y%m%d
'
)
file_path
=
f
"
{
e_p
.
ECCS_STATS_INPUT_DIR
}
/
eccs-uwsgi-req.log
-
{
tmpDate
}
"
file_path
=
f
"
{
e_p
.
ECCS_STATS_INPUT_DIR
}
/
{
e_p
.
ECCS_REQ_LOG
}
-
{
tmpDate
}
"
if
useParsedFile
==
True
:
if
e_p
.
USE_PARSED_DATA
==
True
:
json_file_path
=
f
"
{
e_p
.
ECCS_DIR
}
/parsed/eccs-uwsgi-req-json-
{
tmpDate
}
"
json_file_path
=
f
"
{
e_p
.
ECCS_DIR
}
/parsed/eccs-uwsgi-req-json-
{
tmpDate
}
"
try
:
try
:
f
=
open
(
json_file_path
)
f
=
open
(
json_file_path
)
...
@@ -499,7 +495,7 @@ class WebData(Resource):
...
@@ -499,7 +495,7 @@ class WebData(Resource):
json_data
=
parseLog
(
lines
,
criteria
)
json_data
=
parseLog
(
lines
,
criteria
)
if
useParsedFile
==
True
and
'
idp
'
not
in
criteria
and
'
reg_auth
'
not
in
criteria
:
if
e_p
.
USE_PARSED_DATA
==
True
and
'
idp
'
not
in
criteria
and
'
reg_auth
'
not
in
criteria
:
storeParsedDay
(
json_file_path
,
json_data
)
storeParsedDay
(
json_file_path
,
json_data
)
except
FileNotFoundError
as
e
:
except
FileNotFoundError
as
e
:
...
@@ -549,7 +545,7 @@ api.add_resource(Help, '/') # Route_1
...
@@ -549,7 +545,7 @@ api.add_resource(Help, '/') # Route_1
api
.
add_resource
(
Test
,
'
/test
'
)
# Route_2
api
.
add_resource
(
Test
,
'
/test
'
)
# Route_2
api
.
add_resource
(
EccsResults
,
'
/eccsresults
'
)
# Route_3
api
.
add_resource
(
EccsResults
,
'
/eccsresults
'
)
# Route_3
api
.
add_resource
(
FedStats
,
'
/fedstats
'
)
# Route_4
api
.
add_resource
(
FedStats
,
'
/fedstats
'
)
# Route_4
api
.
add_resource
(
WebData
,
'
/
webd
at
a
'
)
# Route_4
api
.
add_resource
(
WebData
,
'
/
usagest
at
s
'
)
# Route_4
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
eccs_properties.py
+
6
−
0
View file @
170d87dc
...
@@ -82,6 +82,12 @@ ECCS_SELENIUM_SCRIPTTIMEOUT = 60 #seconds
...
@@ -82,6 +82,12 @@ ECCS_SELENIUM_SCRIPTTIMEOUT = 60 #seconds
# Statistics
# Statistics
ECCS_STATS_INPUT_DIR
=
f
"
{
ECCS_DIR
}
/stats
"
ECCS_STATS_INPUT_DIR
=
f
"
{
ECCS_DIR
}
/stats
"
# Requests Statistics
ECCS_LOG_FILE_ROTATED
=
True
# Read daily rotated files
USE_PARSED_DATA
=
False
# Read parsed data from files
ECCS_REQ_LOG_DIR
=
f
"
{
ECCS_DIR
}
/logs
"
ECCS_REQ_LOG
=
f
"
eccs-uwsgi-req.log
"
# Number of processes to run in parallel
# Number of processes to run in parallel
ECCS_NUMPROCESSES
=
30
ECCS_NUMPROCESSES
=
30
...
...
This diff is collapsed.
Click to expand it.
web/index.php
+
0
−
15
View file @
170d87dc
...
@@ -57,7 +57,6 @@ $data[ 'check_result' ] = htmlspecialchars($_GET[ "check_result" ] ?? null);
...
@@ -57,7 +57,6 @@ $data[ 'check_result' ] = htmlspecialchars($_GET[ "check_result" ] ?? null);
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"eccs.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"eccs.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"statistics.css"
/>
<script>
<script>
$
(
function
()
{
$
(
function
()
{
$
(
"
#datepicker
"
).
datepicker
({
$
(
"
#datepicker
"
).
datepicker
({
...
@@ -126,21 +125,7 @@ $data[ 'check_result' ] = htmlspecialchars($_GET[ "check_result" ] ?? null);
...
@@ -126,21 +125,7 @@ $data[ 'check_result' ] = htmlspecialchars($_GET[ "check_result" ] ?? null);
var
check_result
=
"
<?php
echo
$data
[
'check_result'
]
?>
"
;
var
check_result
=
"
<?php
echo
$data
[
'check_result'
]
?>
"
;
</script>
</script>
<script
type=
"text/javascript"
src=
"eccs.js"
></script>
<script
type=
"text/javascript"
src=
"eccs.js"
></script>
<script
type=
"text/javascript"
src=
"statistics.js"
></script>
</div>
<!-- END eccs-central -->
</div>
<!-- END eccs-central -->
<div
id=
"statisticsModal"
class=
"modal"
>
<div
class=
"modal-content"
>
<span
class=
"close"
>
×
</span>
<div
class=
"chart-error"
style=
"display: none;"
>
<i
class=
"fa fa-exclamation-triangle"
></i>
Something happened. Can't retrieve data
</div>
<div
class=
"chart-container"
>
<canvas
id=
"statistics"
></canvas>
</div>
<div
class=
"data-container"
>
</div>
</div>
</div>
</div>
<!-- END main_body -->
</div>
<!-- END main_body -->
</div>
<!-- END wrap -->
</div>
<!-- END wrap -->
<?php
include
'footer.php'
;
?>
<?php
include
'footer.php'
;
?>
...
...
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