added a couple more patterns for overload report.
[feisty_meow.git] / scripts / notes / info_overload_report.sh
1
2 # these metrics are how bogged down we are in to-do type items.
3
4 REPORT_FILE="$HOME/cloud/overload_history.txt"
5
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()
9 {
10   local dir="$1"; shift
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 ' '
12 }
13
14 ##############
15
16 # notes are individual files of tasks, usually, although some are combined.
17 note_depth=$(calculate_depth ~/cloud/grunty_notes)
18
19 # unsorted files haven't been categorized yet.
20 unsorted_depth=$(calculate_depth ~/cloud/unsorted)
21
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)
25
26 # the list files are web documents with to-do lists.  individual items are marked with <li>.
27 item_depth=$(find ~/cloud/grunty_notes/ -type f -iname "*.html" -exec grep "<li" "{}" ';' | wc -l | tr -d ' ')
28
29 # scan across all appropriately named folders in our folders that live in the "cloud".
30 cloud_project_depth=0
31 for i in ~/cloud/*project* ~/cloud/*research*; do
32   temp_depth=$(calculate_depth $i)
33   cloud_project_depth=$(($cloud_project_depth + $temp_depth))
34 done
35
36 # also snag the files labelled as trivia, since they're still to-dos...
37 cloud_trivia_depth=0
38 for i in ~/cloud/*trivia*; do
39   temp_depth=$(calculate_depth $i)
40   cloud_trivia_depth=$(($cloud_trivia_depth + $temp_depth))
41 done
42
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.
46 cloud_active_depth=0
47 for i in ~/cloud/*active*; do
48   temp_depth=$(calculate_depth $i)
49   cloud_active_depth=$(($cloud_active_depth + $temp_depth))
50 done
51
52 #hmmm: the find and add thing is starting to look like a useful function.
53
54 ##############
55
56 total_overload=$(($note_depth + $item_depth + $unsorted_depth + $source_example_depth + $cloud_project_depth + $cloud_trivia_depth + $cloud_active_depth))
57
58 report="\
59 \n\
60 Current information overload consists of:\n\
61 [gathered on $(date)]\n\
62 \n\
63   $note_depth\tgrunty notes\n\
64   $item_depth\tto-do list items\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\
70   -------\n\
71   $total_overload\ttotal items\n\
72 \n\
73 ##############"
74
75 echo -e "$report" | tee -a "$REPORT_FILE"
76