Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesletts committed Oct 15, 2014
1 parent 63a46ee commit cd039a2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion multi-core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/python26
import json
from pprint import pprint
FILE="data/monitor-multicore-production-2014-10-15-Z15:25.json"
FILE="/crabprod/CSstoragePath/Monitor-json/monitor-multicore-production-2014-10-15-Z19:28.json"
with open(FILE) as json_data:
d = json.load(json_data)
json_data.close()
Expand Down
23 changes: 17 additions & 6 deletions multi-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ condor_status -pool $COLLECTOR \
-const '(SlotType=?="Partitionable")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -37,6 +38,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -49,6 +51,7 @@ condor_status -pool $COLLECTOR \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -62,6 +65,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -73,6 +77,7 @@ condor_status -pool $COLLECTOR \
-const '(SlotType=?="Dynamic")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -85,6 +90,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -97,6 +103,7 @@ condor_status -pool $COLLECTOR \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -110,6 +117,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -121,6 +129,7 @@ condor_status -pool $COLLECTOR \
-const '(SlotType=?="Static")' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -133,6 +142,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -145,6 +155,7 @@ condor_status -pool $COLLECTOR \
-const '(GLIDEIN_ToRetire=!=UNDEFINED)&&(CurrentTime>GLIDEIN_ToRetire)' \
-format '%s ' State -format '%s\n' Activity | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -158,6 +169,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Cpus -format '%s ' State -format '%s\n' Activity | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -170,6 +182,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Name -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -183,6 +196,7 @@ condor_status -pool $COLLECTOR \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 " " $4 }' | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -196,6 +210,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' Name -format '%s ' State -format '%s\n' Activity | \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -210,6 +225,7 @@ condor_status -pool $COLLECTOR \
grep ^slot[0-9]*\@ | awk '{print $2 " " $3 " " $4 }' | \
awk ' { for (i=$1; i>0; i--) { print $2 " " $3 } }' | sort | uniq -c | \
awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -221,6 +237,7 @@ condor_status -pool $COLLECTOR \
-format '%s ' State -format '%s\n' Activity \
| sort |uniq -c \
| awk '{printf(" [\"%s\",\"%s\",%i],\n",$2,$3,$1)}'
echo " [null,null,0]"
echo " ]"
echo " },"

Expand All @@ -241,12 +258,6 @@ echo " }"
echo "}"


echo
echo "For comparison:"
echo condor_status -total -pool $COLLECTOR
condor_status -total -pool $COLLECTOR


return
}

Expand Down

0 comments on commit cd039a2

Please sign in to comment.