V
V
Vyacheslav Belyaev2017-10-10 18:33:01
PHP
Vyacheslav Belyaev, 2017-10-10 18:33:01

How to write a service for determining the speed of loading a site?

I need to determine periodically and automatically the speed of loading sites and uptime. Sites without visits, only for analysis. By uptime - just make a request to the site once a minute, and if there is a result, then everything is fine. But I don’t know how to determine the download speed. Maybe there are services where there is a free API or any advice on how to approach this?
As a result, I need to determine the reliability and speed of hosting.
More clarifications: You need either a service with a free api, or how to write this business in php

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Alexander Pushkarev, 2017-10-10
@AXP-dev

1) https://chrome.google.com/webstore/detail/page-loa...
2) Dev tools

I
Igor Vorotnev, 2017-10-10
@HeadOnFire

There is such a chic service - https://apex.sh/ping/
True, now there are no free accounts there anymore, but if you take the matter seriously, then this service is worth every dollar. There are many similar services, Google to help. Many have basic free accounts.
For more serious monitoring and analysis on the backend side, there is https://newrelic.com
Basic download speed indicators can also be tracked using Google Analytics. Separately, you can track only uptime, for example, using https://uptimerobot.com

B
Boris Korobkov, 2017-10-10
@BorisKorobkov

https://ru.wikipedia.org/wiki/Nagios

O
Oleg, 2017-10-10
@politon

Download speed is a very relative figure.
1. ISP restrictions
2. Hoster
3. User's hardware
4. Line
...
Ping is also relative.
So the only option is to give phpmicrotime()

<?php
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
//Дальше исполняемый код...
//В конец страницы
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo 'Страница загружена '.$total_time.' seconds.'."\n";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question