Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
analysis
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ExplorViz
explorviz-github-archive
analysis
Commits
037a87ec
Commit
037a87ec
authored
10 years ago
by
Florian Fittkau
Browse files
Options
Downloads
Patches
Plain Diff
jdbc monitoring
parent
e36eaf0f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+100
-0
100 additions, 0 deletions
...rviz/live_trace_processing/reader/TCPReaderOneClient.java
with
100 additions
and
0 deletions
src/explorviz/live_trace_processing/reader/TCPReaderOneClient.java
+
100
−
0
View file @
037a87ec
...
@@ -18,6 +18,9 @@ import explorviz.live_trace_processing.record.IRecord;
...
@@ -18,6 +18,9 @@ import explorviz.live_trace_processing.record.IRecord;
import
explorviz.live_trace_processing.record.event.constructor.AfterConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.constructor.AfterConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.constructor.AfterFailedConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.constructor.AfterFailedConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.constructor.BeforeConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.constructor.BeforeConstructorEventRecord
;
import
explorviz.live_trace_processing.record.event.jdbc.AfterFailedJDBCOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.jdbc.AfterJDBCOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.jdbc.BeforeJDBCOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterFailedOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterFailedOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.AfterOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.BeforeOperationEventRecord
;
import
explorviz.live_trace_processing.record.event.normal.BeforeOperationEventRecord
;
...
@@ -278,6 +281,34 @@ class TCPReaderOneClient implements Runnable {
...
@@ -278,6 +281,34 @@ class TCPReaderOneClient implements Runnable {
buffer
.
compact
();
buffer
.
compact
();
return
;
return
;
}
}
case
BeforeJDBCOperationEventRecord
.
CLAZZ_ID
:
{
if
(
buffer
.
remaining
()
>=
BeforeJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH
)
{
readInBeforeJDBCOperationEvent
(
buffer
);
break
;
}
buffer
.
position
(
buffer
.
position
()
-
1
);
buffer
.
compact
();
return
;
}
case
AfterFailedJDBCOperationEventRecord
.
CLAZZ_ID
:
{
if
(
buffer
.
remaining
()
>=
AfterFailedJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH
)
{
readInAfterFailedJDBCOperationEvent
(
buffer
);
break
;
}
buffer
.
position
(
buffer
.
position
()
-
1
);
buffer
.
compact
();
return
;
}
case
AfterJDBCOperationEventRecord
.
CLAZZ_ID
:
{
if
(
buffer
.
remaining
()
>=
AfterJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH
)
{
readInAfterJDBCOperationEvent
(
buffer
);
break
;
}
buffer
.
position
(
buffer
.
position
()
-
1
);
buffer
.
compact
();
return
;
}
case
BeforeOperationEventRecord
.
CLAZZ_ID_FROM_WORKER
:
{
case
BeforeOperationEventRecord
.
CLAZZ_ID_FROM_WORKER
:
{
if
(
buffer
.
remaining
()
>=
4
)
{
if
(
buffer
.
remaining
()
>=
4
)
{
final
int
recordSize
=
buffer
.
getInt
();
final
int
recordSize
=
buffer
.
getInt
();
...
@@ -901,6 +932,66 @@ class TCPReaderOneClient implements Runnable {
...
@@ -901,6 +932,66 @@ class TCPReaderOneClient implements Runnable {
hostApplicationMetadata
));
hostApplicationMetadata
));
}
}
private
final
void
readInBeforeJDBCOperationEvent
(
final
ByteBuffer
buffer
)
{
final
long
traceId
=
buffer
.
getLong
();
final
int
orderIndex
=
buffer
.
getInt
();
final
int
objectId
=
buffer
.
getInt
();
final
int
operationId
=
buffer
.
getInt
();
final
int
clazzId
=
buffer
.
getInt
();
final
int
interfaceId
=
buffer
.
getInt
();
final
int
sqlStatementId
=
buffer
.
getInt
();
try
{
final
String
operation
=
stringRegistry
.
getStringFromId
(
operationId
);
final
String
clazz
=
stringRegistry
.
getStringFromId
(
clazzId
);
final
String
implementedInterface
=
stringRegistry
.
getStringFromId
(
interfaceId
);
final
String
sqlStatement
=
stringRegistry
.
getStringFromId
(
sqlStatementId
);
putInQueue
(
new
BeforeJDBCOperationEventRecord
(
traceId
,
orderIndex
,
objectId
,
operation
,
clazz
,
implementedInterface
,
sqlStatement
,
hostApplicationMetadata
));
}
catch
(
final
IdNotAvailableException
e
)
{
putInWaitingMessages
(
buffer
,
BeforeJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH
+
1
);
}
}
private
final
void
readInAfterFailedJDBCOperationEvent
(
final
ByteBuffer
buffer
)
{
final
long
timestamp
=
buffer
.
getLong
();
final
long
traceId
=
buffer
.
getLong
();
final
int
orderIndex
=
buffer
.
getInt
();
final
int
causeId
=
buffer
.
getInt
();
try
{
final
String
cause
=
stringRegistry
.
getStringFromId
(
causeId
);
putInQueue
(
new
AfterFailedJDBCOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
cause
,
hostApplicationMetadata
));
}
catch
(
final
IdNotAvailableException
e
)
{
putInWaitingMessages
(
buffer
,
AfterFailedJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID
);
}
}
private
final
void
readInAfterJDBCOperationEvent
(
final
ByteBuffer
buffer
)
{
final
long
timestamp
=
buffer
.
getLong
();
final
long
traceId
=
buffer
.
getLong
();
final
int
orderIndex
=
buffer
.
getInt
();
final
int
formattedReturnValueId
=
buffer
.
getInt
();
try
{
final
String
formattedReturnValue
=
stringRegistry
.
getStringFromId
(
formattedReturnValueId
);
putInQueue
(
new
AfterJDBCOperationEventRecord
(
timestamp
,
traceId
,
orderIndex
,
formattedReturnValue
,
hostApplicationMetadata
));
}
catch
(
final
IdNotAvailableException
e
)
{
putInWaitingMessages
(
buffer
,
AfterJDBCOperationEventRecord
.
COMPRESSED_BYTE_LENGTH_WITH_CLAZZ_ID
);
}
}
private
final
void
putInWaitingMessages
(
final
ByteBuffer
buffer
,
final
int
length
)
{
private
final
void
putInWaitingMessages
(
final
ByteBuffer
buffer
,
final
int
length
)
{
final
byte
[]
message
=
new
byte
[
length
];
final
byte
[]
message
=
new
byte
[
length
];
buffer
.
position
(
buffer
.
position
()
-
length
);
buffer
.
position
(
buffer
.
position
()
-
length
);
...
@@ -968,6 +1059,15 @@ class TCPReaderOneClient implements Runnable {
...
@@ -968,6 +1059,15 @@ class TCPReaderOneClient implements Runnable {
case
AfterReceivedRemoteCallRecord
.
CLAZZ_ID
:
case
AfterReceivedRemoteCallRecord
.
CLAZZ_ID
:
readInAfterReceivedRemoteCallEvent
(
buffer
);
readInAfterReceivedRemoteCallEvent
(
buffer
);
break
;
break
;
case
BeforeJDBCOperationEventRecord
.
CLAZZ_ID
:
readInBeforeJDBCOperationEvent
(
buffer
);
break
;
case
AfterFailedJDBCOperationEventRecord
.
CLAZZ_ID
:
readInAfterFailedJDBCOperationEvent
(
buffer
);
break
;
case
AfterJDBCOperationEventRecord
.
CLAZZ_ID
:
readInAfterJDBCOperationEvent
(
buffer
);
break
;
default
:
default
:
break
;
break
;
}
}
...
...
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