定制 hashman/status_track 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hashman/status_track

Composer 安装命令:

composer require hashman/status_track

包简介

You can add the status track checkpoint to check the program performance

README 文档

README

Author

Change Log

  • 2016.09.09
    1. Track Status Log main function

Usage

Simple useage

  • sample.php
<?php

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

    use Track\Track;

    $track = new Track();
    for ($i = 0; $i<5; $i++) {
        for ($j = 0; $j<10000000; $j++) {}
        $track->addCheckPoint("Run {$i} Time");
    }
    $track->finish();
  • Result
********************************
* Program start at 08:28:03
********************************
Run 0 Time: 1 seconds
Run 1 Time: 1 seconds
Run 2 Time: 1 seconds
Run 3 Time: 1 seconds
Run 4 Time: 1 seconds
********************************
* Program start End at 08:28:08
* Run 0 Time : 20.00 %
* Run 1 Time : 20.00 %
* Run 2 Time : 20.00 %
* Run 3 Time : 20.00 %
* Run 4 Time : 20.00 %
********************************

Non log mode usage

  • sample.php
<?php

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

    use Track\Track;

    $track = new Track('Hash Test Program', true);
    for ($i = 0; $i<5; $i++) {
        for ($j = 0; $j<10000000; $j++) {}
        $track->addCheckPoint("Run {$i} Time");
    }
    $track->finish();
  • Result
    • Default put the log file in storage/track_log.log file
# cat storage/track_log.log
********************************
* Program start at 08:28:03
********************************
Run 0 Time: 1 seconds
Run 1 Time: 1 seconds
Run 2 Time: 1 seconds
Run 3 Time: 1 seconds
Run 4 Time: 1 seconds
********************************
* Program start End at 08:28:08
* Run 0 Time : 20.00 %
* Run 1 Time : 20.00 %
* Run 2 Time : 20.00 %
* Run 3 Time : 20.00 %
* Run 4 Time : 20.00 %
********************************

How to customize my log path and log file name

  • sample.php
<?php

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

    use Track\Track;

    $track = new Track('Hash Test Program', true, '/tmp/hashman', 'hash_track.log');
    for ($i = 0; $i<5; $i++) {
        for ($j = 0; $j<10000000; $j++) {}
        $track->addCheckPoint("Run {$i} Time");
    }
    $track->finish();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-09-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固