1 # VPP stats segment FUSE filesystem {#stats_fs_doc}
3 The statfs binary allows to create a FUSE filesystem to expose and to browse the stats segment.
4 It relies on the Go-FUSE library and requires Go-VPP stats bindings to work.
6 The binary mounts a filesystem on the local machine whith the data from the stats segments.
7 The counters can be opened and read as files (e.g. in a Unix shell).
8 Note that the value of a counter is determined when the corresponding file is opened (as for /proc/interrupts).
10 Directories update their contents on epoch changes so that new counters get added to the filesystem.
12 The script `install.sh` is responsible for buildiing and installing the filesystem.
16 The local Makefile contains targets for all the possible intercations with the stats_f binary.
31 Starts the filesystem. Requires a running VPP instance using the default socket /run/vpp/stats.sock.
33 May require a privileged user (sudo)
39 Stops and unmounts the filesystem if it is not busy.
41 May require a privileged user (sudo)
47 Forces the unmount of the filesystem even if it is busy.
49 May require a privileged user (sudo)
55 Cleaning stats_fs binary.
57 May require a privileged user (sudo).
62 ## Browsing the filesystem
64 The default mountpoint is /run/vpp/stats_fs_dir.
65 You can browse the filesystem as a regular user.
69 cd /run/vpp/stats_fs_dir
75 ## Building and mounting the filesystem manually
77 For more modularity, you can build and mount the filesystem manually.
80 Inside the local directory, you can build the go binary:
86 Then, ou can mount the filesystem with the local binary.
88 May require a privileged user (sudo).
92 ./stats_fs <MOUNT_POINT>
96 - debug \<true|false\> (default is false)
97 - socket \<statSocket\> (default is /run/vpp/stats.sock) : VPP socket for stats
100 ### Unmounting the file system
102 You can unmount the filesystem with the fusermount command.
104 May require a privileged user (sudo)
107 fusermount -u /path/to/mountpoint
110 To force the unmount even if the resource is busy, add the -z option:
112 fusermount -uz /path/to/mountpoint