go-echo

command module
v0.0.0-...-ef49307 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2020 License: MIT Imports: 13 Imported by: 0

README

go-echo

Test of Echo Go Web Framework

Sommaire

Golang web server in production

Creating a Service for Systemd
touch /lib/systemd/system/<service name>.service

Edit file:

[Unit]
Description=<service description>
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=<path to exec with arguments>

[Install]
WantedBy=multi-user.target
Commande Description
service <service name> start To launch
service <service name> enable To enable on boot
service <service name> disable To disable on boot
service <service name> status To show status
service <service name> stop To stop

Mesure et performance

Go met à disposition de puissants outils pour mesurer les performances des programmes :

  • pprof (graph, flamegraph, peek)
  • trace
  • cover

=> Lien vers une vidéo intéressante Mesure et optimisation de la performance en Go

pprof

Lancer :

curl http://localhost:8888/debug/pprof/heap?seconds=10 > <fichier à analyser>

Puis :

go tool pprof -http :7000 <fichier à analyser> # Interface web
go tool pprof --nodefraction=0 -http :7000 <fichier à analyser> # Interface web avec tous les noeuds
go tool pprof <fichier à analyser> # Ligne de commande
trace

Lancer :

go test <package path> -trace=<fichier à analyser>
curl localhost:<port>/debug/pprof/trace?seconds=10 > <fichier à analyser>

Puis :

go tool trace <fichier à analyser>
cover

Lancer :

go test <package path> -covermode=count -coverprofile=./<fichier à analyser>

Puis :

go tool cover -html=<fichier à analyser>

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL