Created
July 9, 2025 11:04
-
-
Save MasWag/22fb7ebf6a2e0a96ca573b00ea7b03ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/symon -pnf | |
############################################################### | |
# Name | |
# periodic_fetch.symon | |
# | |
# Description | |
# SyMon specification to make sure that for any application ID, | |
# the time gap between two consecutive fetch must be bounded by | |
# a certain time_bound. By running SyMon, one can see the | |
# maximum time_bound so far. If you only want to get the final result, | |
# you can filter the output, for example, as follows: | |
# | |
# symon -pnf ./periodic_fetch.symon -i log.txt | awk '{results[$6] = $0}END{for (key in results) {print results[key]}}' | |
# | |
# Usage | |
# symon -pnf periodic_fetch.symon -i log.txt | |
# | |
# Author | |
# Masaki Waga | |
############################################################### | |
var { | |
# We define a string parameter to represent the current application ID. | |
current_name: string; | |
# We have a timing parameter for bounding the duration between two consecutive fetch events. | |
time_bound: param; | |
} | |
signature create { | |
name: string; | |
tag: string; | |
} | |
signature fetch { | |
name: string; | |
tag: string; | |
} | |
expr relevant_fetch { | |
# We ignore irrelevant events before relevant fetch events | |
zero_or_more { | |
one_of { | |
create(name, tag) | |
} or { | |
fetch(name, tag | name != current_name ) | |
} | |
}; | |
fetch(name, tag | name == current_name ) | |
} | |
relevant_fetch; | |
zero_or_more { | |
within (< time_bound) { | |
relevant_fetch | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment