定制 julioserpone/sla-manager 二次开发

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

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

julioserpone/sla-manager

最新稳定版本:v1.0.2

Composer 安装命令:

composer require julioserpone/sla-manager

包简介

A PHP package for calculating & tracking the Service Level Agreement completion timings

README 文档

README

Logo for SLA Timer

Latest Version on Packagist Total Downloads GitHub Actions

A PHP package to calculate and track Service Level Agreement completion times.

Inspired from the sla-timer pack.

Features

  • 🕚 Easy schedule building
  • ‼️ Defined breaches
  • 🏝 Holiday & Paused Durations
Hi, I'm Julio & I'm currently looking for a Laravel job. Please reach out to me via twitter, or click this link.

Installation

You can install the sla-manager via composer:

composer require julioserpone/sla-manager

Getting Started

The best place to get started with SLA timer is to head over to the ✨ SLA Timer Getting Started Documentation.

Example Usage

To create a new SLA Timer, we can start by defining our SLA Schedule:

require 'vendor/autoload.php';

use JulioSerpone\SlaManager\SLA;
use JulioSerpone\SlaManager\SLABreach;
use JulioSerpone\SlaManager\SLASchedule;

/**
 * Create a new SLA between 9am and 5:30pm weekdays
 */
$sla = SLA::fromSchedule(
    SLASchedule::create()->from('09:00:00')->to('17:30:00')
        ->onWeekdays()
);

We can define out breaches by calling the addBreaches method on our SLA

/**
 * Define two breaches, one at 24 hours, and the next at 100 hours
 */
$sla->addBreaches([
    new SLABreach('First Response', '24h'),
    new SLABreach('Resolution', '100h'),
]);

Now that our SLA Schedule and SLA Breaches are defined, all we have to do is give our subject "creation time" – or our SLA start time – to either the status method, or the duration method.

// Given the time now is 14:00:00 29-07-2022
$status = $sla->status('05:35:40 25-07-2022'); // SLAStatus
$status->breaches; // [SLABreach] [0: { First Response } ]

$duration = $sla->duration('05:35:40 25-07-2022'); // CarbonInterval
$duration->forHumans(); // 1 day 15 hours

Testing

composer test

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固