Cat { public static Transaction newTransaction(String type, String name) { if (isEnabled()) { try { return Cat.getProducer().newTransaction(type, name); } catch (Exception e) { errorHandler(e); return NullMessage.TRANSACTION; } } else { return NullMessage.TRANSACTION; } } private  Cat(); static boolean isJstackEnabled(); static String createMessageId(); static void enable(); static void disable(); static void disableDataSourceMonitor(); static void disableJstack(); static void disableMultiInstances(); static void enableMultiInstances(); static String getCatHome(); static String getCurrentMessageId(); static Cat getInstance(); static MessageManager getManager(); static MessageProducer getProducer(); static void initialize(); static void initialize(String... servers); static void initializeByDomain(String domain); static void initializeByDomain(String domain, int port, int httpPort, String... servers); static void initializeByDomain(String domain, String... servers); static void initializeByDomainForce(String domain); static boolean isDataSourceMonitorEnabled(); static boolean isEnabled(); static boolean isInitialized(); static boolean isMultiInstanceEnable(); static void logBatchEvent(String type, String name, int count, int error); static void logBatchTransaction(String type, String name, int count, int error, long sum); static void logError(String message, Throwable cause); static void logError(Throwable cause); static void logErrorWithCategory(String category, String message, Throwable cause); static void logErrorWithCategory(String category, Throwable cause); static void logEvent(String type, String name); static void logEvent(String type, String name, String status, String nameValuePairs); static void logMetricForCount(String name); static void logMetricForCount(String name, int quantity); static void logMetricForCount(String name, int quantity, Map<String, String> tags); static void logMetricForCount(String name, Map<String, String> tags); static void logMetricForDuration(String name, long durationInMillis); static void logMetricForDuration(String name, long durationInMillis, Map<String, String> tags); static void logRemoteCallClient(Context ctx); static void logRemoteCallClient(Context ctx, String domain); static void logRemoteCallServer(Context ctx); static void newCompletedTransactionWithDuration(String type, String name, long duration); static Event newEvent(String type, String name); static Trace newTrace(String type, String name); static Transaction newTransaction(String type, String name); static Transaction newTransactionWithDuration(String type, String name, long duration); final static String CLIENT_CONFIG; final static String UNKNOWN; }
@Test public void transaction() { Transaction transaction = Cat.newTransaction("test", "test"); transaction.setStatus(Message.SUCCESS); transaction.complete(); }