Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
uphrh-smf-analytics
Commits
ab301b4a
Commit
ab301b4a
authored
2 years ago
by
Darshan M N
Browse files
Options
Download
Patches
Plain Diff
Adding Average Days taken Visualization
parent
9bfe3e46
master
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/main/java/com/tarento/analytics/handler/IResponseHandler.java
+2
-0
.../java/com/tarento/analytics/handler/IResponseHandler.java
src/main/java/com/tarento/analytics/service/impl/QueryServiceImpl.java
+7
-1
.../com/tarento/analytics/service/impl/QueryServiceImpl.java
src/main/resources/schema/SMF_ChartApiConfig.json
+30
-0
src/main/resources/schema/SMF_ChartApiConfig.json
src/main/resources/schema/SMF_MasterDashboardConfig.json
+9
-0
src/main/resources/schema/SMF_MasterDashboardConfig.json
with
48 additions
and
1 deletion
+48
-1
src/main/java/com/tarento/analytics/handler/IResponseHandler.java
+
2
−
0
View file @
ab301b4a
...
...
@@ -217,6 +217,8 @@ public interface IResponseHandler {
sortedMap
.
get
(
plKey
).
setValue
(
value
);
}
}
logger
.
info
(
"after appending missing plots : "
+
sortedMap
);
data
.
setPlots
(
sortedMap
.
values
().
stream
().
collect
(
Collectors
.
toList
()));
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/analytics/service/impl/QueryServiceImpl.java
+
7
−
1
View file @
ab301b4a
...
...
@@ -416,7 +416,13 @@ public class QueryServiceImpl implements QueryService {
@Override
public
ObjectNode
getChartConfigurationQuery
(
AggregateRequestDto
request
,
JsonNode
query
,
String
indexName
,
String
interval
)
{
String
aggrQuery
=
query
.
get
(
Constants
.
JsonPaths
.
AGGREGATION_QUERY
).
asText
();
String
visualizationCode
=
request
.
getVisualizationCode
();
String
aggrQuery
=
null
;
if
(
"averageDaysTakenToCompleteInspection"
.
equals
(
visualizationCode
))
{
aggrQuery
=
"{\"aggs\":{\"Filters\":{\"filter\":{\"exists\":{\"field\":\"createdDate\"}},\"aggs\":{\"Filters2\":{\"filter\":{\"exists\":{\"field\":\"inspection.inspectionCompletedDate\"}},\"aggs\":{\"Average Response Days\":{\"avg\":{\"script\":\"(doc['inspection.inspectionCompletedDate'].value.toInstant().toEpochMilli()- doc['createdDate'].value.toInstant().toEpochMilli())/1000/86400\"}}}}}}}}"
;
}
else
{
aggrQuery
=
query
.
get
(
Constants
.
JsonPaths
.
AGGREGATION_QUERY
).
asText
();
}
if
(
interval
!=
null
&&
!
interval
.
isEmpty
())
aggrQuery
=
aggrQuery
.
replace
(
Constants
.
JsonPaths
.
INTERVAL_VAL
,
interval
);
String
rqMs
=
query
.
get
(
Constants
.
JsonPaths
.
REQUEST_QUERY_MAP
).
asText
();
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/schema/SMF_ChartApiConfig.json
+
30
−
0
View file @
ab301b4a
...
...
@@ -168,6 +168,36 @@
"Application Inspection Trend"
,
"Application Submission Trend"
],
"isCumulative"
:
true
,
"interval"
:
"day"
,
"alwaysView"
:
""
,
"insight"
:
{},
"_comment"
:
" "
},
"averageDaysTakenToCompleteInspection"
:
{
"chartName"
:
"Average Days Taken to Complete Inspection"
,
"queries"
:
[
{
"module"
:
"COMMON"
,
"requestQueryMap"
:
"{
\r\n
\"
ts
\"
:
\"
timestamp
\"
}"
,
"dateRefField"
:
"timestamp"
,
"indexName"
:
"fs-forms-data"
,
"esInstance"
:
"QUADNARY"
,
"aggrQuery"
:
""
}
],
"chartType"
:
"metric"
,
"resultType"
:
"value"
,
"valueType"
:
"number"
,
"isDecimal"
:
true
,
"action"
:
""
,
"filter"
:
""
,
"drillChart"
:
"none"
,
"documentType"
:
"_doc"
,
"aggregationPaths"
:
[
"Average Response Days"
],
"isCumulative"
:
true
,
"interval"
:
"day"
,
...
...
This diff is collapsed.
Click to expand it.
src/main/resources/schema/SMF_MasterDashboardConfig.json
+
9
−
0
View file @
ab301b4a
...
...
@@ -28,6 +28,15 @@
"order"
:
1
,
"filter"
:
""
,
"headers"
:
[]
},
{
"id"
:
"averageDaysTakenToCompleteInspection"
,
"name"
:
"Average Days Taken to Complete Inspection"
,
"code"
:
""
,
"chartType"
:
"metric"
,
"order"
:
1
,
"filter"
:
""
,
"headers"
:
[]
}
],
"visualizations"
:
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets