graveyard / gearcmd

Utility to create gearman workers out of command-line programs
Apache License 2.0
13 stars 0 forks source link

write all stderr lines at once #60

Closed natebrennand closed 7 years ago

natebrennand commented 7 years ago

tested w/ gearman-admin-load-tester in clever-dev: https://clever-dev--gearman-admin.int.clever.com/jobs/?function=gearman-admin-load-tester

diff applied for test:

diff --git a/Makefile b/Makefile
index 0cadf7e..6d32101 100644
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,8 @@ $(eval $(call golang-version-check,1.7))
 test: $(PKGS)

 run: build
-       gearcmd --name=gearman-admin-load-tester --cmd=bin/gearman-admin-load-tester --parseargs=false
+       ../gearcmd/build/gearcmd-v0.8.5-darwin-amd64/gearcmd --name=gearman-admin-load-tester --cmd=bin/gearman-admin-load-tester --parseargs=false
+

 build:
        go build -o bin/$(EXECUTABLE) $(PKG)
diff --git a/main.go b/main.go
index 2b444af..9bc3b56 100644
--- a/main.go
+++ b/main.go
@@ -34,7 +34,7 @@ func main() {
        }

        sleepDuration := time.Second * time.Duration(randInt64(10))
-       lg.InfoD("sleeping", logger.M{"duration": sleepDuration})
+       lg.InfoD("sleeping", logger.M{"duration": sleepDuration.String()})
        time.Sleep(sleepDuration)

        numSpawnedJobs := int(randInt64(3))
@@ -49,7 +49,7 @@ func main() {
                }
        }

-       lg.InfoD("hipster-ipsum", logger.M{"text": hipsterIpsum[:randInt64(5000)]})
+       lg.InfoD("hipster-ipsum", logger.M{"text": hipsterIpsum[:randInt64(500)]})
 }

 const hipsterIpsum = `Williamsburg copper mug subway tile blog hammock migas, messenger bag skateboard distillery aesthetic direct trade. Before they sold out paleo chambray fanny pack lumbersexual, mlkshk ethical tbh sustainable hammock. Drinking vinegar enamel pin ethical, cardigan cray man bun fixie lyft distillery microdosing woke. Austin chillwave 3 wolf moon, leggings shoreditch poutine knausgaard literally activated charcoal craft beer listicle pinterest. Paleo selvage 8-bit swag four dollar toast. Fashion axe meditation semiotics, tbh 8-bit lyft blog crucifix woke tattooed. Readymade squid flannel, poke echo park cronut tumeric portland helvetica activated charcoal organic vaporware quinoa. Brooklyn single-origin coffee messenger bag, subway tile poke art party gastropub coloring book hella you probably haven't heard of them live-edge. Helvetica microdosing distillery kickstarter roof party shoreditch, yuccie tumeric four dollar toast meh cliche succulents selfies. Fixie roof party live-edge kogi, organic vaporware leggings chia polaroid occupy iceland art party activated charcoal. Microdosing blue bottle schlitz deep v, mustache flannel raw denim XOXO la croix. Next level coloring book iceland, lomo salvia vaporware cray chia four loko fam neutra. Pug retro distillery migas, mixtape meh artisan af. Swag butcher skateboard, photo booth vaporware unicorn try-hard pinterest. Hashtag keytar dreamcatcher, woke bicycle rights williamsburg ramps XOXO direct trade migas irony waistcoat master cleanse neutra. Migas beard lyft synth, meggings fanny pack succulents twee four loko brunch chillwave copper mug. Banh mi butcher godard squid, austin farm-to-table organic kinfolk flannel forage meh crucifix authentic drinking vinegar. Unicorn seitan heirloom selfies, swag fap normcore gluten-free narwhal. Kickstarter mustache man braid listicle blog dreamcatcher, live-edge kitsch raw denim knausgaar
        sleepDuration := time.Second * time.Duration(randInt64(10))
-       lg.InfoD("sleeping", logger.M{"duration": sleepDuration})
+       lg.InfoD("sleeping", logger.M{"duration": sleepDuration.String()})
        time.Sleep(sleepDuration)

        numSpawnedJobs := int(randInt64(3))
@@ -49,7 +49,7 @@ func main() {
                }
        }

-       lg.InfoD("hipster-ipsum", logger.M{"text": hipsterIpsum[:randInt64(5000)]})
+       lg.InfoD("hipster-ipsum", logger.M{"text": hipsterIpsum[:randInt64(500)]})
 }