Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ejercicio2-framework-back
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josue
ejercicio2-framework-back
Commits
bfe18190
Commit
bfe18190
authored
Nov 23, 2021
by
Cristian Aguirre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 'Tiempo de primera respuesta' chart
parent
83408ffc
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
27 deletions
+26
-27
MessageProcessedSupport.java
.../bytesw/bytebot/etl/services/MessageProcessedSupport.java
+6
-6
StartSessionMessageProcessed.java
...sw/bytebot/etl/services/StartSessionMessageProcessed.java
+2
-0
application.yml
src/main/resources/application.yml
+10
-10
SessionMapper.xml
.../resources/config/mappers/bytebot/mysql/SessionMapper.xml
+4
-4
SessionMapper.xml
...sources/config/mappers/bytebot/postgres/SessionMapper.xml
+4
-7
No files found.
src/main/java/com/bytesw/bytebot/etl/services/MessageProcessedSupport.java
View file @
bfe18190
...
...
@@ -2,18 +2,18 @@ package com.bytesw.bytebot.etl.services;
import
com.bytesw.bytebot.etl.dao.SessionBotRepository
;
import
com.bytesw.bytebot.etl.model.Session
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
java.math.BigDecimal
;
import
java.time.Instant
;
import
java.time.OffsetDateTime
;
import
java.time.ZoneId
;
import
java.time.*
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
@Log4j2
public
abstract
class
MessageProcessedSupport
{
protected
static
final
String
SENDER_ID_FIELD_NAME
=
"senderId"
;
...
...
@@ -35,6 +35,7 @@ public abstract class MessageProcessedSupport {
protected
OffsetDateTime
getOffsetDateTimeFromTimestampPython
(
Object
objectTimestamp
)
{
BigDecimal
dateDecimal
;
log
.
debug
(
"TIME MILI: "
+
objectTimestamp
);
if
(
objectTimestamp
instanceof
Double
)
{
dateDecimal
=
new
BigDecimal
((
Double
)
objectTimestamp
);
}
else
{
...
...
@@ -43,16 +44,15 @@ public abstract class MessageProcessedSupport {
}
dateDecimal
=
new
BigDecimal
(
String
.
valueOf
(
objectTimestamp
));
}
Long
timestamp
=
dateDecimal
.
longValue
();
Long
timestamp
=
(
long
)(
dateDecimal
.
doubleValue
()*
1000
);
if
(
String
.
valueOf
(
timestamp
).
length
()
<
13
)
{
int
numberOfZero
=
13
-
String
.
valueOf
(
timestamp
).
length
();
for
(
int
i
=
0
;
i
<
numberOfZero
;
i
++)
{
timestamp
=
timestamp
*
10
;
}
}
OffsetDateTime
date
=
OffsetDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
timestamp
),
ZoneId
.
systemDefault
());
log
.
debug
(
"TIME: "
+
date
);
return
date
;
}
...
...
src/main/java/com/bytesw/bytebot/etl/services/StartSessionMessageProcessed.java
View file @
bfe18190
...
...
@@ -10,6 +10,7 @@ import org.springframework.stereotype.Service;
import
javax.annotation.PostConstruct
;
import
javax.transaction.Transactional
;
import
java.time.OffsetDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.Optional
;
@Service
...
...
@@ -44,6 +45,7 @@ public class StartSessionMessageProcessed extends MessageProcessedSupport implem
if
(
timestamp
!=
null
)
{
// Validate if the below method is ok
DateTimeFormatter
dtf
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss.SSSX"
);
OffsetDateTime
sessionDate
=
getOffsetDateTimeFromTimestampPython
(
timestamp
);
if
(
sessionDate
!=
null
)
{
Session
session
=
new
Session
();
...
...
src/main/resources/application.yml
View file @
bfe18190
...
...
@@ -115,16 +115,16 @@ spring:
hikari.registerMbeans
:
true
security
:
basepath
:
http://
localhost
:9077/bytebot
basepath
:
http://
192.168.1.6
:9077/bytebot
provider
:
byte
# oracle, amazon
oauth2-client
:
clientId
:
xdf-client
clientSecret
:
xdf-secret
accessTokenUri
:
http://1
92.168.1.6
:18080/oauth/token
userAuthorizationUri
:
http://1
92.168.1.6
:18080/oauth/authorize
accessTokenUri
:
http://1
27.0.0.1
:18080/oauth/token
userAuthorizationUri
:
http://1
27.0.0.1
:18080/oauth/authorize
oauth2-resource
:
userInfoUri
:
http://1
92.168.1.6
:18080/oauth/userinfo
logoutUri
:
http://1
92.168.1.6
:18080/oauth/userlogout
userInfoUri
:
http://1
27.0.0.1
:18080/oauth/userinfo
logoutUri
:
http://1
27.0.0.1
:18080/oauth/userlogout
tenants
:
-
id
:
T186A1
...
...
@@ -142,16 +142,16 @@ spring:
testWhileIdle
:
true
hikari.registerMbeans
:
true
security
:
basepath
:
http://
localhost
:9077/bytebot
basepath
:
http://
192.168.1.6
:9077/bytebot
provider
:
byte
# oracle, amazon
oauth2-client
:
clientId
:
xdf-client
clientSecret
:
xdf-secret
accessTokenUri
:
http://1
92.168.1.6
:18080/oauth/token
userAuthorizationUri
:
http://1
92.168.1.6
:18080/oauth/authorize
accessTokenUri
:
http://1
27.0.0.1
:18080/oauth/token
userAuthorizationUri
:
http://1
27.0.0.1
:18080/oauth/authorize
oauth2-resource
:
userInfoUri
:
http://1
92.168.1.6
:18080/oauth/userinfo
logoutUri
:
http://1
92.168.1.6
:18080/oauth/userlogout
userInfoUri
:
http://1
27.0.0.1
:18080/oauth/userinfo
logoutUri
:
http://1
27.0.0.1
:18080/oauth/userlogout
jpa
:
...
...
src/main/resources/config/mappers/bytebot/mysql/SessionMapper.xml
View file @
bfe18190
...
...
@@ -34,7 +34,7 @@
<select
id=
"avgFirstResponseTime"
resultType=
"Long"
flushCache=
"true"
>
SELECT AVG(RESP_TIME)
FROM (
select TIMESTAMPDIFF(SECOND, SESSION_DATE, SESSION_FRDAT)
AS RESP_TIME
select TIMESTAMPDIFF(MICROSECOND, SESSION_DATE, SESSION_FRDAT)/1000
AS RESP_TIME
from AVB_SESSION bs WHERE SESSION_FRDAT IS NOT NULL
AND SESSION_DATE
<
= #{endDate}
AND SESSION_DATE
>
= #{startDate}
...
...
src/main/resources/config/mappers/bytebot/postgres/SessionMapper.xml
View file @
bfe18190
...
...
@@ -34,10 +34,7 @@
<select
id=
"avgFirstResponseTime"
resultType=
"Double"
flushCache=
"true"
>
SELECT AVG(RESP_TIME)
FROM (
SELECT ((DATE_PART('day', SESSION_FRDAT - SESSION_DATE) * 24 +
DATE_PART('hour', SESSION_FRDAT - SESSION_DATE)) * 60 +
DATE_PART('minute', SESSION_FRDAT - SESSION_DATE)) * 60 +
DATE_PART('second', SESSION_FRDAT - SESSION_DATE) AS RESP_TIME
SELECT DATE_PART('milliseconds', SESSION_FRDAT - SESSION_DATE) AS RESP_TIME
from AVB_SESSION bs WHERE SESSION_FRDAT IS NOT null
AND SESSION_DATE
<
= #{endDate}
AND SESSION_DATE
>
= #{startDate}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment