public void connected() { final String dictProfilerMetric = PROFILER.getProcessMetric("network.channel.binary.*"); profilerMetric = PROFILER.getProcessMetric( "network.channel.binary." + socket.getRemoteSocketAddress().toString() +":"+ socket.getLocalPort() + "".replace('.', '_')); PROFILER.registerHookValue(profilerMetric + ".transmittedBytes", "Bytes transmitted to a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() { public Object getValue() { return metricTransmittedBytes; } }, dictProfilerMetric + ".transmittedBytes"); PROFILER.registerHookValue(profilerMetric + ".receivedBytes", "Bytes received from a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() { public Object getValue() { return metricReceivedBytes; } }, dictProfilerMetric + ".receivedBytes"); PROFILER.registerHookValue(profilerMetric + ".flushes", "Number of times the network channel has been flushed", METRIC_TYPE.COUNTER, new OProfilerHookValue() { public Object getValue() { return metricFlushes; } }, dictProfilerMetric + ".flushes"); }
public void connected() { final String dictProfilerMetric = PROFILER.getProcessMetric("network.channel.binary.*"); profilerMetric = PROFILER.getProcessMetric("network.channel.binary." + socket.getRemoteSocketAddress().toString() + socket.getLocalPort() + "".replace('.', '_')); PROFILER.registerHookValue(profilerMetric + ".transmittedBytes", "Bytes transmitted to a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() { public Object getValue() { return metricTransmittedBytes; } }, dictProfilerMetric + ".transmittedBytes"); PROFILER.registerHookValue(profilerMetric + ".receivedBytes", "Bytes received from a network channel", METRIC_TYPE.SIZE, new OProfilerHookValue() { public Object getValue() { return metricReceivedBytes; } }, dictProfilerMetric + ".receivedBytes"); PROFILER.registerHookValue(profilerMetric + ".flushes", "Number of times the network channel has been flushed", METRIC_TYPE.COUNTER, new OProfilerHookValue() { public Object getValue() { return metricFlushes; } }, dictProfilerMetric + ".flushes"); }
public byte[] toStream(final ORecord iRecord, boolean iOnlyDelta) { final long timer = PROFILER.startChrono(); try { return toString(iRecord, new StringBuilder(2048), null, iOnlyDelta, true).toString().getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { throw OException.wrapException(new OSchemaException("error encoding string"), e); } finally { PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.toStream"), "Serialize record to stream", timer); } }
@Override public ORecord fromStream(final byte[] iSource, final ORecord iRecord, final String[] iFields) { final long timer = PROFILER.startChrono(); try { return fromString(new String(iSource,"UTF-8"), iRecord, iFields); } catch (UnsupportedEncodingException e) { throw OException.wrapException(new OSchemaException("Error reading record"),e); } finally { PROFILER .stopChrono(PROFILER.getProcessMetric("serializer.record.string.fromStream"), "Deserialize record from stream", timer); } }
case STRING: simpleValueToStream(iBuffer, iType, iValue); PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.string2string"), "Serialize string to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.bool2string"), "Serialize boolean to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.int2string"), "Serialize integer to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.float2string"), "Serialize float to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.decimal2string"), "Serialize decimal to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.long2string"), "Serialize long to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.double2string"), "Serialize double to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.short2string"), "Serialize short to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.byte2string"), "Serialize byte to string", timer); break;
PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.link2string"), "Serialize link to string", timer); .stopChrono(PROFILER.getProcessMetric("serializer.record.string.linkList2string"), "Serialize linklist to string", timer); break; .stopChrono(PROFILER.getProcessMetric("serializer.record.string.linkSet2string"), "Serialize linkset to string", timer); break; .stopChrono(PROFILER.getProcessMetric("serializer.record.string.linkMap2string"), "Serialize linkmap to string", timer); break; iOutput.append(iValue.toString()); PROFILER .stopChrono(PROFILER.getProcessMetric("serializer.record.string.embed2string"), "Serialize embedded to string", timer); break; embeddedCollectionToStream(null, iOutput, iLinkedClass, iLinkedType, iValue, iSaveOnlyDirty, false); PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.embedList2string"), "Serialize embeddedlist to string", timer); break; embeddedCollectionToStream(null, iOutput, iLinkedClass, iLinkedType, iValue, iSaveOnlyDirty, true); PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.embedSet2string"), "Serialize embeddedset to string", timer); break; PROFILER.stopChrono(PROFILER.getProcessMetric("serializer.record.string.embedMap2string"), "Serialize embeddedmap to string",