本文整理匯總了TypeScript中src/util/fixLong.FixLong函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript FixLong函數的具體用法?TypeScript FixLong怎麽用?TypeScript FixLong使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了FixLong函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: addStatementStats
export function addStatementStats(a: StatementStatistics, b: StatementStatistics) {
const countA = FixLong(a.count).toInt();
const countB = FixLong(b.count).toInt();
return {
count: a.count.add(b.count),
first_attempt_count: a.first_attempt_count.add(b.first_attempt_count),
max_retries: a.max_retries.greaterThan(b.max_retries) ? a.max_retries : b.max_retries,
num_rows: addNumericStats(a.num_rows, b.num_rows, countA, countB),
parse_lat: addNumericStats(a.parse_lat, b.parse_lat, countA, countB),
plan_lat: addNumericStats(a.plan_lat, b.plan_lat, countA, countB),
run_lat: addNumericStats(a.run_lat, b.run_lat, countA, countB),
service_lat: addNumericStats(a.service_lat, b.service_lat, countA, countB),
overhead_lat: addNumericStats(a.overhead_lat, b.overhead_lat, countA, countB),
};
}
示例2: IsLeader
export function IsLeader(info: protos.cockroach.server.serverpb.RangeInfo$Properties) {
const localRep = GetLocalReplica(info);
if (_.isNil(localRep)) {
return false;
}
return Long.fromInt(localRep.replica_id).eq(FixLong(info.raft_state.lead));
}
示例3: getRangeLog
export function getRangeLog(
req: RangeLogRequestMessage,
timeout?: moment.Duration,
): Promise<RangeLogResponseMessage> {
const rangeID = FixLong(req.range_id);
const rangeIDQuery = (rangeID.eq(0)) ? "" : `/${rangeID.toString()}`;
const limit = (!_.isNil(req.limit)) ? `?limit=${req.limit}` : "";
return timeoutFetch(
serverpb.RangeLogResponse,
`${API_PREFIX}/rangelog${rangeIDQuery}${limit}`,
null,
timeout,
);
}
示例4: IsLeaseEpoch
export function IsLeaseEpoch(lease: protos.cockroach.roachpb.ILease) {
return !FixLong(lease.epoch).eq(0);
}
示例5: stdDevLong
export function stdDevLong(stat: NumericStat, count: number | Long) {
return stdDev(stat, FixLong(count).toInt());
}