2 # these metrics are how bogged down we are in to-do type items.
4 REPORT_FILE="$HOME/cloud/overload_history.txt"
6 # given a path, this will find how many items are under it, ignoring svn and git files, plus
7 # other patterns we happen to notice are not useful.
8 function calculate_depth()
11 find "$dir" -type f -exec echo \"{}\" ';' | grep -v "\.svn" | grep -v "\.git"| grep -v "\.basket" | grep -v "\.version" | grep -v "\.keep" | wc -l | tr -d ' '
16 # notes are individual files of tasks, usually, although some are combined.
17 note_depth=$(calculate_depth ~/cloud/grunty_notes)
19 # unsorted files haven't been categorized yet.
20 unsorted_depth=$(calculate_depth ~/cloud/unsorted)
22 # source examples need to be sucked into other places, other codebases. they are not
23 # supposed to pile up here.
24 source_example_depth=$(calculate_depth ~/cloud/example_source)
26 # the list files are web documents with to-do lists. individual items are marked with <li>.
27 html_item_depth=$(find ~/cloud/grunty_notes/ -type f -iname "*.html" -exec grep "<li" "{}" ';' | wc -l | tr -d ' ')
29 # scan across all appropriately named folders in our folders that live in the "cloud".
31 for i in ~/cloud/*project* ~/cloud/*research*; do
32 temp_depth=$(calculate_depth $i)
33 cloud_project_depth=$(($cloud_project_depth + $temp_depth))
36 # also snag the files labelled as trivia, since they're still to-dos...
38 for i in ~/cloud/*trivia*; do
39 temp_depth=$(calculate_depth $i)
40 cloud_trivia_depth=$(($cloud_trivia_depth + $temp_depth))
43 # and then count up the things that we think will be cleaned soon, but one thing we have learned
44 # is that things that are intended are not always followed up on right away. this catches us
45 # being too hopeful and makes sure nothing seems to be getting done that's lagging.
47 for i in ~/cloud/*active*; do
48 temp_depth=$(calculate_depth $i)
49 cloud_active_depth=$(($cloud_active_depth + $temp_depth))
52 #hmmm: the find and add thing is starting to look like a useful function.
56 total_overload=$(($note_depth + $html_item_depth + $unsorted_depth + $source_example_depth + $cloud_project_depth + $cloud_trivia_depth + $cloud_active_depth))
60 Current information overload consists of:\n\
61 [gathered on $(date)]\n\
63 $note_depth\tgrunty notes\n\
64 $html_item_depth\tto-do notes in html\n\
65 $cloud_active_depth\tactive items\n\
66 $cloud_project_depth\tproject files\n\
67 $source_example_depth\tsource examples\n\
68 $cloud_trivia_depth\ttrivial notes\n\
69 $unsorted_depth\tunsorted files\n\
71 $total_overload\ttotal items\n\
75 echo -e "$report" | tee -a "$REPORT_FILE"