browsertime 19.3.0 → 19.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +2 -0
- package/package.json +2 -2
- package/visualmetrics/__init__.py +1 -0
- package/visualmetrics/test_data/ms_000000.png +0 -0
- package/visualmetrics/test_data/ms_000920.png +0 -0
- package/visualmetrics/test_data/ms_001000.png +0 -0
- package/visualmetrics/test_data/ms_001080.png +0 -0
- package/visualmetrics/test_data/ms_001200.png +0 -0
- package/visualmetrics/test_data/ms_001240.png +0 -0
- package/visualmetrics/test_data/ms_001280.png +0 -0
- package/visualmetrics/test_data/ms_001360.png +0 -0
- package/visualmetrics/test_data/ms_001400.png +0 -0
- package/visualmetrics/test_data/ms_001520.png +0 -0
- package/visualmetrics/test_data/ms_002040.png +0 -0
- package/visualmetrics/test_data/ms_002600.png +0 -0
- package/visualmetrics/test_data/ms_003160.png +0 -0
- package/visualmetrics/test_data/ms_003720.png +0 -0
- package/visualmetrics/test_data/ms_004280.png +0 -0
- package/visualmetrics/test_data/ms_004880.png +0 -0
- package/visualmetrics/test_data/ms_005440.png +0 -0
- package/visualmetrics/test_data/ms_006000.png +0 -0
- package/visualmetrics/test_visualmetrics.py +34 -0
- package/visualmetrics/visualmetrics-portable.py +1969 -0
- package/visualmetrics/visualmetrics.py +2518 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -185,6 +185,8 @@ Join our community! Whether you need help, want to share your experience, or dis
|
|
|
185
185
|
|
|
186
186
|
- **Slack**: Connect with fellow users and the development team on [Slack](https://join.slack.com/t/sitespeedio/shared_invite/zt-296jzr7qs-d6DId2KpEnMPJSQ8_R~WFw).
|
|
187
187
|
- **GitHub Issues**: For technical questions, feature requests, and bug reports, use our [GitHub issues](https://github.com/sitespeedio/browsertime/issues).
|
|
188
|
+
- **RSS/Changelog**: Latest releases and information can always be found in our [RSS feed](https://github.com/sitespeedio/browsertime/releases.atom) and in our [changelog](https://github.com/sitespeedio/browsertime/blob/main/CHANGELOG.md).
|
|
189
|
+
- **Mastodon**: Follow us on Mastodon [https://fosstodon.org/@sitespeedio](https://fosstodon.org/@sitespeedio).
|
|
188
190
|
|
|
189
191
|
We're excited to have you in our community and look forward to your contributions and interactions!
|
|
190
192
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browsertime",
|
|
3
3
|
"description": "Get performance metrics from your web page using Browsertime.",
|
|
4
|
-
"version": "19.3.
|
|
4
|
+
"version": "19.3.1",
|
|
5
5
|
"bin": "./bin/browsertime.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"dependencies": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"bin",
|
|
57
57
|
"browserscripts",
|
|
58
58
|
"browsersupport",
|
|
59
|
-
"
|
|
59
|
+
"visualmetrics",
|
|
60
60
|
"browsertime.png",
|
|
61
61
|
"docs",
|
|
62
62
|
"index.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import unittest
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
from browsertime.visualmetrics import (
|
|
5
|
+
calculate_contentful_speed_index,
|
|
6
|
+
calculate_perceptual_speed_index,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
HERE = os.path.dirname(__file__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class TestVisualMetrics(unittest.TestCase):
|
|
13
|
+
def setUp(self):
|
|
14
|
+
self.directory = "test_data"
|
|
15
|
+
images = os.listdir(os.path.join(HERE, self.directory))
|
|
16
|
+
|
|
17
|
+
def _p(image):
|
|
18
|
+
p = {}
|
|
19
|
+
p["time"] = int(image.split(".")[0].split("ms_")[-1])
|
|
20
|
+
return p
|
|
21
|
+
|
|
22
|
+
progress = [_p(image) for image in images if image.startswith("ms_")]
|
|
23
|
+
self.sorted_progress = sorted(progress,
|
|
24
|
+
key = lambda image: image['time'])
|
|
25
|
+
|
|
26
|
+
def test_calculate_contentful_speed_index(self):
|
|
27
|
+
res = calculate_contentful_speed_index(self.sorted_progress,
|
|
28
|
+
self.directory)
|
|
29
|
+
self.assertEqual(res[0], 1188)
|
|
30
|
+
|
|
31
|
+
def test_calculate_perceptual_speed_index(self):
|
|
32
|
+
res = calculate_perceptual_speed_index(self.sorted_progress,
|
|
33
|
+
self.directory)
|
|
34
|
+
self.assertEqual(res[0], 946)
|