/** * Clear active tag used when accounting {@link Socket} traffic originating * from the current thread. */ public static void clearThreadStatsTag() { IMPL.clearThreadStatsTag(); }
/** * Get the active tag used when accounting {@link Socket} traffic originating * from the current thread. Only one active tag per thread is supported. * {@link #tagSocket(Socket)}. */ public static int getThreadStatsTag() { return IMPL.getThreadStatsTag(); }
/** * Increment count of network operations performed under the given * accounting tag. This can be used to derive bytes-per-operation. * * @param tag Accounting tag used in {@link #setThreadStatsTag(int)}. * @param operationCount Number of operations to increment count by. */ public static void incrementOperationCount(int tag, int operationCount) { IMPL.incrementOperationCount(tag, operationCount); }
/** * Set active tag to use when accounting {@link Socket} traffic originating * from the current thread. Only one active tag per thread is supported. * <p> * Changes only take effect during subsequent calls to * {@link #tagSocket(Socket)}. * <p> * Tags between {@code 0xFFFFFF00} and {@code 0xFFFFFFFF} are reserved and * used internally by system services like DownloadManager when performing * traffic on behalf of an application. */ public static void setThreadStatsTag(int tag) { IMPL.setThreadStatsTag(tag); }
/** * Increment count of network operations performed under the accounting tag * currently active on the calling thread. This can be used to derive * bytes-per-operation. * * @param operationCount Number of operations to increment count by. */ public static void incrementOperationCount(int operationCount) { IMPL.incrementOperationCount(operationCount); }
/** * Tag the given {@link Socket} with any statistics parameters active for * the current thread. Subsequent calls always replace any existing * parameters. When finished, call {@link #untagSocket(Socket)} to remove * statistics parameters. * * @see #setThreadStatsTag(int) */ public static void tagSocket(Socket socket) throws SocketException { IMPL.tagSocket(socket); }
/** * Remove any statistics parameters from the given {@link Socket}. */ public static void untagSocket(Socket socket) throws SocketException { IMPL.untagSocket(socket); } }