Похожие чаты

I'M in a situation where I have to execute a

bunch of unix commands "every second". things like device temperature, RX,TX packets, etc...

so my original solution was to use exec (https://www.npmjs.com/package/promisify-child-process)

and everything seems to be working just fine. but I don't know the right tools to benchmark my application. or whether is it ok to use child-process every second?

and I have another idea to create two Named Pipe, one with bash (to listen for keywords and execute the commands) and one with nodeJS (to receive the results).

so am I crazy for thinking that my original method is suspicus or the second idea is better ?

3 ответов

16 просмотров

You can probably obtain the data without spawning a new process

Пользователь-61933 Автор вопроса

so this is what I ended up doing. node spawns monitor.sh. then monitor.sh sends the result in a JSON format to IPC every second. so let me know what you think about this approach though I don't know any specific method for benchmarking node. the result from top command shows 3-7% CPU usage for monitor.sh and 1% for node and I'm aware that some of them can be used in node directly like /sys/class/net/"$iface"/statistics/"$path is a file, so no need for cat ... but this is just an overall view of what I'm trying to do ... so the script will change eventually https://gist.github.com/itshaadi/56d0c95c55de9e1114032a131c9adda2 @GingerPlusPlus @MKRhere

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта