定制 js/mysqlnd-analytics 二次开发

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

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

js/mysqlnd-analytics

Composer 安装命令:

composer require js/mysqlnd-analytics

包简介

The JSMysqlndAnalytics library is a library to process statistics collected by PHP's myslqnd module and providing guidance for improving applications using ext/mysql, mysqli or pdo_mysql.

README 文档

README

The Mysqlnd Analytics library provides a way for an application to easily collect statistics about MySQL operations for a given period by making use of mysqlnd's statistic collection. This library then provides analytics on top of these statistics to help the user to improve his application.

Requirements

For making use of this library need an application running on a PHP setup where the mysqli extension is activated and mysqlnd is being used. The mysqli extension is only used to retrieve data. It is no requirement for your application to use to use mysqli. Applications using Doctrine and PDO are fully supported.

This library depends on rezzza/Formulate.

Composer

This library can be installed using composer:

$ php composer.phar require "js/mysqlnd-analytics=dev-master"

Take a look at the page on Packagist web site for more details and up-to-date version numbers.

Usage Example

A simple use case might llook like this:

<?php
use JS\Mysqlnd\Analytics\Engine;
use JS\Mysqlnd\Analytics\DefaultRuleProvider;
use JS\Mysqlnd\Analytics\Calculator;
use JS\Mysqlnd\Analytics\Collector;

$collector = new Collector();
$collector->start();
/* run ext/mysql, mysqli or PDO_mysql queries */

$data = $collector->collect();
$analytics = new Engine(new DefaultRuleProvider(), new Calculator($data));

foreach ($analytics as $analytic) {
    if ($analytic->getMatched()) {
        echo $analytic->getName() . '(Severity: '. $analytic->getSeverity() . ")\n";
        echo $analytic->getGuidance()."\n\n";
    }
}

Notes

For Symfony applications an bundle using this library exists.

统计信息

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

GitHub 信息

  • Stars: 33
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固