From mboxrd@z Thu Jan 1 00:00:00 1970 From: Malcolm Matalka Subject: Re: Tracking time from one state to another? Date: Thu, 18 Apr 2019 17:34:17 +0200 Message-ID: <86zhoncop2.fsf@gmail.com> References: <868sw8n7qm.fsf@gmail.com> <878sw7ix52.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:43722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH93f-0007d7-0i for emacs-orgmode@gnu.org; Thu, 18 Apr 2019 11:34:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hH93d-0005qj-Sv for emacs-orgmode@gnu.org; Thu, 18 Apr 2019 11:34:38 -0400 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:44539) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hH93d-0005pL-Kw for emacs-orgmode@gnu.org; Thu, 18 Apr 2019 11:34:37 -0400 Received: by mail-lf1-x12b.google.com with SMTP id h18so1947379lfj.11 for ; Thu, 18 Apr 2019 08:34:37 -0700 (PDT) In-reply-to: <878sw7ix52.fsf@mbork.pl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Marcin Borkowski Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Marcin Borkowski writes: > On 2019-04-17, at 14:20, Malcolm Matalka wrote: > >> Hello, >> >> Is it possible in org-mode to track, and report, the duration of certain >> state transitions in org-mode? In particular, I'm interested in >> tracking how long it takes me to go from a state that means I'm actively >> working on an item to it being in a done state? >> >> In my case, an item might go from working, to waiting, to working, to >> done. And in this case I'm only really interested in the last working >> to done time. >> >> For my case, I'm looking to do a weekly report on how long it takes me >> to complete tasks that I have said I will work on. > > Hi Malcolm, > > that sounds interesting. Since you can turn on logging of state changes > (as you probably know), this is in principle possible, though I don't > think it is built in. > > I guess writing a bit of Elisp to accomplish this should not be very > difficult, though it seems that currently the problem is a bit > underspecified. If you could elaborate, e.g., provide an example of > your state change log and describe the result you would like to get, > I could be tempted to coding this. > > Best, Sure! So for my use case, I'm mostly interested in the last transition to a finished state, but for simplicity I'll specify the two states I'm interested in: Given states NEXT and DONE, I want to know the time between going into NEXT and over to DONE. For example, given the following logbook: :LOGBOOK: - State "DONE" from "NEXT" [2019-04-01 Mon 11:07] - State "NEXT" from "TODO" [2019-04-01 Mon 10:35] - State "NEXT" from "TODO" [2018-07-02 Mon 11:03] :END: This item would be 32 minutes. This one: :LOGBOOK: - State "DONE" from "NEXT" [2019-04-10 Wed 09:56] - State "NEXT" from "WAITING" [2019-04-10 Wed 09:40] - State "WAITING" from "NEXT" [2019-04-09 Tue 10:44] - State "NEXT" from "WAITING" [2019-04-09 Tue 10:10] - State "WAITING" from "NEXT" [2019-04-08 Mon 16:39] - State "NEXT" from "TODO" [2019-04-08 Mon 11:14] :END: Would be 16 minutes. I'd like to specify what time range to do this for, and be able to sort by duration. I think a dynamic block, like clocktable, would probably be a fine. Any idea what the level of work involved is to accomplish this? I'm guessing a very hacky version might be to modify clock table and look at the logbook instead of clock and filter out all but the last transition? Also, this is just the usecase I'm interested in, so if you have thoughts on what a more general form would look like, that would be interested. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEQP2ClpgOfnguJZS++DiEc/oMrtcFAly4mPoACgkQ+DiEc/oM rtdscAgAtsj+ieCC6yVO71Xa6TLPIw4IaXxz1gYua49f8aFo9H8DJ6PL4YtJmShX Ht8RmS3mWh3kdTnYSw8vETKjFKu8oT9Wc5u3I/AOgVNm0vzsFXPzRvEANqUHeHn2 5e4NExCooc6cQeu2ArGHsxZnUbq9w7A8XZDvS9/C56isL3oRt63yD3/90f7Po75V 72MHI68IVe2haL6wgmHxeBPii7T2RyCAfLGtRTs4AabbB0sIsxS0TJaotKqFeIIg rDApdE/sHbxMfKPuRiKV03DxMrPZGGOZ66TWrKjaB27zAiZGLwNQrXoOhb9pq8gM 3bRM2RHBKak2fcghodut02h4c/yyBw== =lmq8 -----END PGP SIGNATURE----- --=-=-=--