All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sviolet.slate.common.x.monitor.txtimer.TxTimerProvider Maven / Gradle / Ivy

/*
 * Copyright (C) 2015-2018 S.Violet
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Project GitHub: https://github.com/shepherdviolet/slate
 * Email: [email protected]
 */

package sviolet.slate.common.x.monitor.txtimer;

/**
 * 

TxTimer简单的交易耗时统计 扩展点

* *

实现:耗时统计/结果输出

* *

使用扩展点之前, 请先仔细阅读文档: https://github.com/shepherdviolet/thistle/blob/master/docs/thistlespi/guide.md

* * @see TxTimer * @author S.Violet */ public interface TxTimerProvider { /** *

交易开始时调用

* * * try { * TxTimer.start("Entrance", "TestService"); * // 交易逻辑 ...... * } finally { * TxTimer.stop(); * } * * * @param groupName 组别 * @param transactionName 交易名 */ void start(String groupName, String transactionName); /** * 交易结束时调用 * * * try { * TxTimer.start("Entrance", "TestService"); * // 交易逻辑 ...... * } finally { * TxTimer.stop(); * } * * */ void stop(); /** * 是否启用统计功能 * @return true 启用 */ boolean enabled(); /** * 是否能通过TxTimer.getProvider()获取到当前实例 * @return true 允许 */ boolean canBeGet(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy