package com.performance;
import java.text.DecimalFormat;
public class Performance {
/**
* PV计算器
* @param args
*/
public static void main(String[] args) {
Performance.count(640000000, 27);
}
/**
*
* @param pv 总PV值
* @param machine 机器数量
*/
public static void count(float pv, float machine) {
DecimalFormat df = new DecimalFormat("#.##");
double avg = (0.8 * pv) / (24 * 60 * 60 * (240 * 1.0 / 480)) / machine;
System.out.println("平均值为:" + df.format(avg) + " pv/s");
double max = (1.2 * 1.6 * pv) * 1.0 / (24 * 60 * 60) * 1.0 / machine;
System.out.println("峰值为:" + df.format(max) + " pv/s");
}
}
高并发数据计算器(这里是个人爱好,仅作分享)
最新推荐文章于 2023-08-02 13:37:46 发布