Create a new transaction with given type and name. @param type transaction type @param name transaction name
(String type, String name)
| 622 | * @param name transaction name |
| 623 | */ |
| 624 | public static Transaction newTransaction(String type, String name) { |
| 625 | if (isEnabled()) { |
| 626 | try { |
| 627 | return Cat.getProducer().newTransaction(type, name); |
| 628 | } catch (Exception e) { |
| 629 | errorHandler(e); |
| 630 | return NullMessage.TRANSACTION; |
| 631 | } |
| 632 | } else { |
| 633 | return NullMessage.TRANSACTION; |
| 634 | } |
| 635 | } |
| 636 | |
| 637 | /** |
| 638 | * Create a new transaction with given type and name and duration, duration time in millisecond |