https://github.com/xmapst/watchmaker
injector which change the time inside the process instead of the host.
https://github.com/xmapst/watchmaker
faketime
Last synced: about 1 year ago
JSON representation
injector which change the time inside the process instead of the host.
- Host: GitHub
- URL: https://github.com/xmapst/watchmaker
- Owner: xmapst
- License: apache-2.0
- Created: 2024-01-11T02:53:15.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-17T02:27:38.000Z (over 1 year ago)
- Last Synced: 2025-03-17T03:29:12.892Z (over 1 year ago)
- Topics: faketime
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# watchmaker
injector which change the time inside the process instead of the host.
## Install
```shell
wget https://github.com/xmapst/watchmaker/releases/download/v0.0.1-rc1/watchmaker_linux_amd64 -O /bin/watchmaker
chmod +x /bin/watchmaker
```
## Usage
```shell
# absolute dates is "YYYY-MM-DD hh:mm:ss"
watchmaker --pid 1536 --faketime "2003-01-01 10:00:05"
# absolute dates is timestamp (seconds or nanosecond)
watchmaker --pid 1536 --faketime 1705022260
# time offset(no units), default is seconds
watchmaker --pid 1536 --faketime +120
# or
watchmaker --pid 1536 --faketime -120
# time offset(s)
watchmaker --pid 1536 --faketime +120s
# or
watchmaker --pid 1536 --faketime -120s
# time offset(m)
watchmaker --pid 1536 --faketime +12m
# or
watchmaker --pid 1536 --faketime -12m
# time offset(h)
watchmaker --pid 1536 --faketime +12h
# or
watchmaker --pid 1536 --faketime -12h
# time offset(d)
watchmaker --pid 1536 --faketime +12d
# or
watchmaker --pid 1536 --faketime -12d
# time offset(y)
watchmaker --pid 1536 --faketime +1y
# or
watchmaker --pid 1536 --faketime -1y
```
## Reference
This project uses the following open-source software:
* [Chaos-mesh](https://github.com/chaos-mesh/chaos-mesh) - Reference chaos-mesh's watchmaker component to simulate process time
* [Libfaketime](https://github.com/wolfcw/libfaketime) - Reference the libfaketime dynamic link library to simulate time
* [timechaos-our-final-hack](https://chaos-mesh.org/blog/simulating-clock-skew-in-k8s-without-affecting-other-containers-on-node/#timechaos-our-final-hack) - Reference the blog to simulate time