diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-01-07 10:16:41 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-01-07 10:16:41 +0100 |
commit | 2c9e1d532eb36bce9167a0ec656808c0a653730a (patch) | |
tree | 58781d4f42f58a8bdc03a0c8a1a5fd3160fa44fb /java/src/IceInternal/InvocationObserverI.java | |
parent | Fixed (ICE-5058) - WinRT port Platform::AccessDeniedException (diff) | |
download | ice-2c9e1d532eb36bce9167a0ec656808c0a653730a.tar.bz2 ice-2c9e1d532eb36bce9167a0ec656808c0a653730a.tar.xz ice-2c9e1d532eb36bce9167a0ec656808c0a653730a.zip |
Fixed ICE-4933: Added size and replySize fields to dispatch and remote invocation metrics, support for requestId attribute
Diffstat (limited to 'java/src/IceInternal/InvocationObserverI.java')
-rw-r--r-- | java/src/IceInternal/InvocationObserverI.java | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/java/src/IceInternal/InvocationObserverI.java b/java/src/IceInternal/InvocationObserverI.java index b3b4605e10e..31816f4b3f7 100644 --- a/java/src/IceInternal/InvocationObserverI.java +++ b/java/src/IceInternal/InvocationObserverI.java @@ -14,7 +14,7 @@ import IceMX.*; public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> implements Ice.Instrumentation.InvocationObserver { - static public final class RemoteInvocationHelper extends MetricsHelper<Metrics> + static public final class RemoteInvocationHelper extends MetricsHelper<RemoteMetrics> { static private final AttributeResolver _attributes = new AttributeResolver() { @@ -24,6 +24,7 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> Class<?> cl = RemoteInvocationHelper.class; add("parent", cl.getDeclaredMethod("getParent")); add("id", cl.getDeclaredMethod("getId")); + add("requestId", cl.getDeclaredMethod("getRequestId")); CommunicatorObserverI.addConnectionAttributes(this, RemoteInvocationHelper.class); } catch(Exception ex) @@ -34,11 +35,19 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> } }; - RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt) + RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.Endpoint endpt, int requestId, int size) { super(_attributes); _connectionInfo = con; _endpoint = endpt; + _requestId = requestId; + _size = size; + } + + public void + initMetrics(RemoteMetrics v) + { + v.size += _size; } public String @@ -54,7 +63,13 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> } return _id; } - + + int + getRequestId() + { + return _requestId; + } + public String getParent() { @@ -92,6 +107,8 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> final private Ice.ConnectionInfo _connectionInfo; final private Ice.Endpoint _endpoint; + final private int _requestId; + final private int _size; private String _id; private Ice.EndpointInfo _endpointInfo; }; @@ -108,10 +125,13 @@ public class InvocationObserverI extends IceMX.Observer<IceMX.InvocationMetrics> forEach(_incrementRetry); } - public Observer - getRemoteObserver(Ice.ConnectionInfo con, Ice.Endpoint endpt) + public Ice.Instrumentation.RemoteObserver + getRemoteObserver(Ice.ConnectionInfo con, Ice.Endpoint edpt, int requestId, int sz) { - return getObserver("Remote", new RemoteInvocationHelper(con, endpt), Metrics.class, ObserverI.class); + return (Ice.Instrumentation.RemoteObserver)getObserver("Remote", + new RemoteInvocationHelper(con, edpt, requestId, sz), + RemoteMetrics.class, + RemoteObserverI.class); } final MetricsUpdate<InvocationMetrics> _incrementRetry = new MetricsUpdate<InvocationMetrics>() |