code: public static boolean isSomethingHappening(Jenkins jenkins) {
          if (!jenkins.getQueue().isEmpty())
              return true;
          for (Computer n : jenkins.getComputers())
              if (!n.isIdle())
                  return true;
          return false;
      }
docs: Returns true if Hudson is building something or going to build something.