Rick Winfrey
bcdf17e0ab
Restrict communication with Gitmon to a single socket connection
...
- Gitmon perceives a socket closing as EOF in the database, and
terminates the record created with the `update` command. This means
that when the `finish` command is issued, the Gitmon database attempts
to insert the process stats as a new record in the Gitmon db.
2017-03-22 17:22:41 -07:00
Rick Winfrey
5ddc4f7074
Manually specify JSON structure (to avoid inclusion of tag
)
2017-03-21 14:51:23 -07:00
Rick Winfrey
4207e5f901
Rework the way we read
a userID or repoID from the environment
...
- TIL : mkRegexWithOpts documentation is misleading. The first boolean
option is described as enforcing beginning of line (`^`) and end of
line (`$`) matching, along with not matching newline characters with
`.`. From my testing, I discovered this is not true, and in order to
enforce that regex behavior, I needed to explicitly add `^…$` to my
regex. Because the `mkRegexWithOpts` function was no longer doing what
I wanted, I opted for the simpler `mkRegex` function.
- readInt now returns a `Maybe Int` and expects a single `Just [s]`
match supplied to attempt reading. This function is not general
purpose enough to be safe to use elsewhere, but is safe to use within
the context of `readIntFromEnv` because of the way the regex enforces
matches.
2017-03-21 10:39:14 -07:00
Rick Winfrey
7d48f6b8ad
Convert to nano secs once
2017-03-20 18:13:11 -07:00
Rick Winfrey
c902c7f393
Send userID and repoID with schedule Gitmon request
2017-03-20 18:12:59 -07:00
Rick Winfrey
b28b8faa05
Add readIntFromEnv function
...
- Allows us to read the Integer value for user_id and repo_id set in
the env when they are prefixed with `uint:`
2017-03-20 18:12:13 -07:00
Rick Winfrey
8737cd0fcc
Add repoID and userID to ProcessUpdateData
2017-03-20 18:10:22 -07:00
Rick Winfrey
d0c6a219e6
🔥 error
2017-03-10 15:30:43 -08:00
Rick Winfrey
10af2e4715
Add 📝 use of BangPatterns
2017-03-09 13:52:30 -08:00
Rick Winfrey
7799f3f5ee
Wrap sending of process stats to gitmon with timeout
...
- In the event sending to the socket blocks we can timeout the
operation.
2017-03-08 11:36:44 -08:00
Rick Winfrey
0192162adb
Wrap connecting to socket with timeout
2017-03-08 11:35:06 -08:00
Rick Winfrey
6dc35dc455
Update gitmon fail status spec
2017-03-08 11:10:57 -08:00
Rick Winfrey
c4dd79717f
Add withGitmonStatus
2017-03-08 10:49:44 -08:00
Rick Winfrey
5df5581507
Add GitmonException
2017-03-08 10:30:32 -08:00
Rick Winfrey
dd7fb995f1
Add safeGetCurrentDirectory
...
- If an exception is thrown performing the `getCurrentDirectory` IO
action, this defaults to an “” String value
2017-03-08 10:19:52 -08:00
Rick Winfrey
165dfcae04
Merge branch 'gitmon-support' into gitmon-support-with-socket
2017-03-07 10:36:43 -08:00
Rick Winfrey
bf2ed8a32a
Remove user_id
2017-03-07 10:33:18 -08:00
Timothy Clem
bf48e443f4
Swap over to new reportGitmon and update tests to match
2017-03-07 08:46:44 -08:00
Timothy Clem
9959025d3b
Use RankNType to implement socket factory
2017-03-06 14:19:48 -08:00
Timothy Clem
23a5374f4a
Use a withSocket approach
2017-03-06 13:51:38 -08:00
Rick Winfrey
87014ed03a
We don't need to track repo id
2017-03-06 11:09:24 -08:00
Timothy Clem
ef6ba4b673
Formatting
2017-03-02 14:08:16 -08:00
Timothy Clem
55faa92182
Quote message received from Gitmon
2017-03-02 14:01:13 -08:00
Timothy Clem
5c437cd253
Report specific message from gitmon
2017-03-02 13:59:13 -08:00
Timothy Clem
695afb494d
Formatting and remove commented out code
2017-03-02 13:58:57 -08:00
Timothy Clem
443b4de54a
Just some formatting
2017-03-02 13:35:51 -08:00
Timothy Clem
a676885ff0
Continue gitCommand if gitmon takes more than 1 sec to respond
2017-03-02 13:30:35 -08:00
Timothy Clem
b6be58f15f
Handle schedule command response
2017-03-02 13:16:38 -08:00
Timothy Clem
b188f185ae
Reformat
2017-03-02 11:56:33 -08:00
Timothy Clem
c6e91e29f5
throwIO after we close the socket instead of re-running the command
2017-03-02 11:53:38 -08:00
Timothy Clem
3f00f98a05
Make sure we release the gitmon socket, even if git command throws
2017-03-02 10:56:05 -08:00
Timothy Clem
74b093dd02
Refactor to one safeIO
2017-03-02 10:27:16 -08:00
Timothy Clem
f327257b53
Add safeIOValue so we can still run gitCommand even if socket create fails
2017-03-02 10:22:02 -08:00
Rick Winfrey
42b96851fa
🔥 redundant imports and out of data field functions
2017-03-01 16:57:32 -08:00
Rick Winfrey
0954699b12
Add happy path GitmonClient spec
2017-03-01 14:11:16 -08:00
Rick Winfrey
86e2698192
Rename ProcessStats -> ProcessData
2017-03-01 14:07:08 -08:00
Rick Winfrey
177a26b1ad
Avoid explicitly naming each field for constructing ProcessBeforeStats
2017-02-28 15:31:55 -08:00
Rick Winfrey
08a474310f
No longer pass Arguments to reportGitmon
2017-02-28 15:31:19 -08:00
Rick Winfrey
503cb15ef2
Add loadEnvVars function
2017-02-28 15:30:42 -08:00
Rick Winfrey
3cd8d626dc
Use constructorTagModifier
for generic GitmonCommand instance
2017-02-28 15:28:20 -08:00
Rick Winfrey
68fc139341
Use generic ToJSON instance for GitmonCommand
2017-02-28 15:28:05 -08:00
Rick Winfrey
f483587128
Abc imports
2017-02-28 15:27:33 -08:00
Rick Winfrey
277a801d7f
🔥 unnecessary import
2017-02-28 15:27:25 -08:00
Rick Winfrey
8ebddf4dd7
Remove allEnv debugging
...
- Confirmed that github/github gitrpc environment to read_toc_summary
is missing user_id, repo_id and repo_name
2017-02-25 17:07:26 -08:00
Rick Winfrey
75175e2f45
Bump mac-os build
2017-02-24 17:37:09 -08:00
Rick Winfrey
70743c5fa0
Add missing fields to data types
2017-02-24 17:13:47 -08:00
Rick Winfrey
e4744b2e8f
Add all env vars for debugging
2017-02-24 17:05:21 -08:00
Rick Winfrey
a7d76aa3da
Extract collectStats and procStats functions
2017-02-23 17:08:01 -08:00
Rick Winfrey
3038ea734c
Add procStats function
2017-02-23 16:56:02 -08:00
Rick Winfrey
d80b437ab1
Add ProcInfo type synonym
2017-02-23 16:53:55 -08:00