
Research
/Security News
Shai Hulud Strikes Again (v2)
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.
@happysanta/js-stats-collector
Advanced tools
```js const collector = require("@happysanta/js-stats-collector")
const collector = require("@happysanta/js-stats-collector")
collector.appName = "my_clever_app"
// --- Пареметры сохраняемые раз в минуту
// таблица t_my_clever_app
//все значения -- только целые числа
collector.sum("request_count", 1)
collector.sum("request_count", 2)
collector.sum("request_count", 5)
//Сумма всех значений -- 8
collector.min("min_request_time", 1)
collector.min("min_request_time", 2)
collector.min("min_request_time", 5)
//Минимум значений -- 1
collector.max("max_request_time", 1)
collector.max("max_request_time", 2)
collector.max("max_request_time", 5)
//Максимуму значений -- 5
collector.set("current_users_count", 1)
collector.set("current_users_count", 2)
collector.set("current_users_count", 5)
//Последнее из значений -- 5
collector.avg("request_time", 1)
collector.avg("request_time", 2)
collector.avg("request_time", 5)
//Средее значений -- 2 (без дробной части)
//HyperLogLog
// парамтр -- строка до 1000 символов, без символа : внутри
collector.hll("unique_group_ids", "2050")
collector.hll("unique_group_ids", "2051")
collector.hll("unique_group_ids", "2055")
collector.hll("unique_group_ids", "2051")
//unique_group_ids -- 3 потому что 3 уникальных значеия было передано
// --- Парраметры сохраняемые раз в 5 минут
// таблица t_str_my_clever_app
collector.strSum("active_groups", "2051", 1)
collector.strSum("active_groups", "2052", 1)
collector.strSum("active_groups", "2053", 1)
//active_groups будет хранить 3 значния, если за 5 минут будет передано больше 100 уникальных значений, то сохраняться 100 самых частовстречающихся
//Чтобы в бд подгружалась название группы имя метрики должно заканчиваться на _group_id
//в строке должен быть id группы, тогда в таблице в колонке pattern будет имя группы а в node_id -- id группы
FAQs
```js const collector = require("@happysanta/js-stats-collector")
We found that @happysanta/js-stats-collector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Another wave of Shai-Hulud campaign has hit npm with more than 500 packages and 700+ versions affected.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.