Download the PHP package robertogallea/laravel-metrics without Composer

On this page you can find all versions of the php package robertogallea/laravel-metrics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-metrics

LaravelMetrics

Packagist Version GitHub Workflow Status

Introduction

This package allows to record metrics in your laravel application and performing statistics.

It also provides tools for implementing simple alerting mechanisms.

Installation

In order to install the package run

composer require robertogallea/laravel-metrics

Laravel auto-discovery will register package ServiceProvider and Aliases.

Configuration

If you wish to edit the package configuration run

Usage

The package relies on the concept of Metric. A metric is a measure of some type inside the application.

Currently, two types of measures are supported:

Markers are just their name. These could be used to determine how many times an event occurred in your application.

Timers tracks events duration. These could be useful to determine how long events took to complete.

Save metrics

This is the simplest way of using metrics. In any part of your code you can save metrics as follows:

By default, timers are stored using seconds resolution. However, desired resolution can be changed before stopping the timer:

Storing metadata

If needed, you can also store additional metadata in your metrics, by passing a data array to the mark() or start()/stop() methods:

Marker

Timer

or

Measuring events

You could automatically save marker metrics during event dispatch by doing three steps:

Now, whenever you dispatch an event, the marker is automatically saved:

Creating measurable events

For your convenience a command is registered for creating measurable events:

Measuring requests

You can also instrument your requests by using two middlewares provided:

A Marker is saved with the home-visits name;

A Timer containing the request duration is saved with the page-visit-duration name.

Timer could be set to a specific resolution using a second parameter.

Retrieving metrics

There are two options for retrieving metrics:

Time series

One of the most important aspect of using metrics is extracting time series from them with convenient statistics.

Currently supported statistics are count, average, max and min.

Time series are generated as custom collection of type MetricCollection.

Statistics on time series

Once a time series is extracted, you can perform statistics on it. In addition to standard Collection methods, like mean(), max(), min(), avg(), etc., the MetricCollection class adds methods for performing other operations. Actually the following are supported:

Treeware

You're free to use this package, but if it makes it to your production environment you are required to buy the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to plant trees. If you support this package and contribute to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees here offset.earth/treeware

Read more about Treeware at treeware.earth

Issues, Questions and Pull Requests

You can report issues and ask questions in the issues section. Please start your issue with ISSUE: and your question with QUESTION:

If you have a question, check the closed issues first. Over time, I've been able to answer quite a few.

To submit a Pull Request, please fork this repository, create a new branch and commit your new/updated code in there. Then open a Pull Request from your new branch. Refer to this guide for more info.


All versions of laravel-metrics with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2|^8.0
illuminate/support Version ^6|^7|^8
spatie/test-time Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package robertogallea/laravel-metrics contains the following files

Loading the files please wait ....