petenelson/progress-estimator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

petenelson/progress-estimator

Composer 安装命令:

composer require petenelson/progress-estimator

包简介

PHP class to estimate time remaining for a list of tasks

README 文档

README

PHP library to estimate time remaining for a list of tasks.

Percentage of issues still open

When processing a batch of items that takes a long time to run, this library can be used to to calculate and display the estimated time remaining.

Processing 12 items
[1/12]: Bacon ipsum dolor amet (0:35)
[2/12]: Cow porchetta labore shankle (0:33)
[3/12]: Filet mignon porchetta eiusmod tri-tip (0:28)
[4/12]: Venison aliqua, ad brisket pariatur (0:22)
[5/12]: Turkey reprehenderit picanha (0:18)
[6/12]: Turducken fatback ground round (0:16)
[7/12]: Strip steak leberkas laborum (0:12)
[8/12]: Pork belly excepteur buffalo (0:09)
[9/12]: ham chuck ipsum nostrud jerky (0:07)
[10/12]: Rump shank jalapeno (0:05)
[11/12]: Pancetta chicken do spare ribs, (0:02)
[12/12]: Meatball tenderloin picanha (0:00)

Installation and Usage

This package can be installed via composer.

composer require petenelson/progress-estimator

Here is some example code below, and be sure to check the examples.php file for a working implementation.

require_once __DIR__ . '/vendor/autoload.php';

$items = get_large_list_of_items();
$count = count($items);

// Create the progress estimator.
$estimator = new \PHPEstimator\ProgressEstimator($count);

// Loop through the list of items to process.
for ($i=0; $i < $count; $i++) {

	// Perform some work on each item.
	some_long_running_process_here($items[$i]);

	// Increments the counter and saves the execution time of that item.
	$estimator->tick();

	// Display the current item processed and estimated time remaining.
	$output = sprintf(
		'Processed: %1$s (%2$s)' . PHP_EOL,
		$i,
		$estimator->formatTime($estimator->timeLeft())
	);

	echo $output;
}

petenelson/progress-estimator 适用场景与选型建议

petenelson/progress-estimator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 26.09k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 04 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 petenelson/progress-estimator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 petenelson/progress-estimator 我们能提供哪些服务?
定制开发 / 二次开发

基于 petenelson/progress-estimator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 26.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-04-15