Rick Winfrey
69e791c4a1
🔥 disabling of unused do bind
2017-03-24 11:29:19 -07:00
Rick Winfrey
fa206dc250
🔥 note about BangPatterns
2017-03-24 11:29:02 -07:00
Rick Winfrey
3b8553f912
Trying to surface error
2017-03-23 17:05:57 -07:00
Rick Winfrey
1604f6ca34
Add back strictness
2017-03-23 16:50:34 -07:00
Rick Winfrey
9fe095474f
Strictness not required
2017-03-23 16:39:06 -07:00
Rick Winfrey
f60f90045d
Remove "\n"
2017-03-23 16:12:11 -07:00
Rick Winfrey
c6300449df
This is equivalent to Ruby regex \A
and \Z
for treating start of line and end of line the start of input and end of input, and ignores newlines
2017-03-23 11:32:49 -07:00
Rick Winfrey
95e751f0e0
🔥 whitespace
2017-03-23 09:38:36 -07:00
Rick Winfrey
37e6929d3b
Use safeGitmonIO for connecting to Unix socket
2017-03-23 09:26:54 -07:00
Rick Winfrey
a176dda44a
combine safeIO and timeout functionality into a single function
2017-03-22 17:23:36 -07:00
Rick Winfrey
58ce25aa30
Send CPU time in milliseconds, not nanoseconds
2017-03-22 17:23:02 -07:00
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