Screen Player


Published on

Purpose of creating Screen Player,,
Adapting to screen's logging system, Player in action, Charts builder, Screen Player Structure,
Code documentation

Published in: Technology, Art & Photos
1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Screen Player

  1. 1. Screen Player Bogdan Klichuk © Quintagroup 2009
  2. 2. Table of Contents <ul><li>Purpose
  3. 3.
  4. 4. Adapting to screen's logging system
  5. 5. Player in action
  6. 6. Charts builder
  7. 7. Structure
  8. 8. Code documentation </li></ul>
  9. 9. Purpose
  10. 10. <ul><li>Playback of the logs – simulating the original interaction of the user and terminal, recorder by 'screen' </li></ul>Purpose - load - tempo - speed Input echo Record Playback Screen player screen
  11. 11. <ul><li>Explore logs, navigate, have control on the playback's behavior, like using the media player </li></ul>Purpose
  12. 12. Demo
  13. 13. <ul><li>Investigate terminal activity and busyness, compare, generate charts for visual investigation </li></ul>Purpose
  14. 14.
  15. 15. is a Python utility, enabling you to access all the Screen Player's functionality rapidly Works with Python >= 2.5
  16. 16. by itself does not provide and does not implement any functionality, instead it provides a set of tasks, each of which can handle different work arguments
  17. 17. Screen Player provides multi-level config system. Any command line option for a specified task can be stored in config section, named after the task. Options at the level with higher priority override the same options at The level with lower priority. For example to set option -s STEP, --step=STEP for ' play': [play] step = 10 Levels priority order (ascending) Config system in Screen Player Execute task -с (--config) for any task
  18. 18. Adapting to screen's logging system
  19. 19. Adapting to screen's logging system How does Screen Player play back the logs saving the nature of the interaction and time characteristics? Time stamps allow you to restore the real speed, tempo and load of the 'screen' terminal, when the logs where being written. Two ways of how Screen Player plays back: <ul><li>Uses time stamps, built into log file by 'screen'
  20. 20. Writes it's own time stamps, tracking the changes to the size of the log file (needs the utility to be launched while logging)
  21. 21. Screen Player can be adapted to the
  22. 22. format of the screen's time stamp.
  23. 23. Here's the example of default
  24. 24. screen's time stamp: [2] </li></ul>
  25. 25. Adapting to screen's logging system Time line 0 Stamp, 200 bytes Stamp, 800 bytes Stamp, 2000 bytes Stamp, 2100 bytes Structure of time stamps: Time stamp here is an exact moment of time and the size of the log file in this moment of time. Stamps data can be stored in different, yet 3 formats: <ul><li>Python pickle format
  26. 26. CSV
  27. 27. Protocol buffer 2 [3]
  28. 28. (Language,platform independent) </li></ul>
  29. 29. Adapting to screen's logging system Track log file size and writing time stamps manually, track This command shows help for the task : To start tracking a file logfile.txt and producing stamps to logfile.txt.times , use this: To start tracking a file logfile.txt and producing stamps to custom stamps file, use this: Option --storage enables you to choose a type of the storage for the time-stamps: pickle, csv etc.
  30. 30. Adapting to screen's logging system Splitting the log file with built-in stamps to separate time stamps storage and clean log data, split Let us split the log file logfile_dirty.txt with built-in stamps, produce the clean log to logfile_clean.txt and store time stamps In logfile_clean.txt.times (adjusted implicitly): If you need just to clean up the log file from the built-in time stamps, use flag – c . In this case time stamps won't be stored. Type of the time stamps storage can be set by a flag --storage
  31. 31. Player in action Playback of the log file, having separate time-stamps and log files, play To start playing back a log file logfile.txt , when the time stamps storage is logfile.times, use this: -t option will let you set the time stamps storage explicitly. Start from the specified moment of time, defining a start point using a --jump(-j) option. A value has to be a screen player's ISO 8601 time stamp.
  32. 32. Playback of the log file with built-in time-stamps Player in action Assume, that you have a large log file, produced by screen with “ logtstamp” option on, and you want to play it back easily, not having to worry about the separate time-stamps storage and “clean” log file. Use -d (--dirty) option:
  33. 33. Player in action Screen player's ISO 8601 date/time format A basic format of the date/time in ISO 8601 is: Screen player offers optional ISO 8601 format, when any count of the parameter can be omitted and inherited from the default date/time. For example: In ' play' our stamp is based on a default stamp – first one from the time stamps storage, here we omitted the month, day, hour and Time zone – all this parameters will be inherited from the default stamp
  34. 34. Adapting to screen's logging system Investigating the time line, tinfo Let us retrieve the information about the time line, using time stamps storage logfile.times. The command shows the start & end points, count of stamps, full duration of the time line: To write all the time stamps to a file as CSV values, use flag -- all :
  35. 35. Player in action List of the shortcuts can be retrieved using this command: Controlling the playback. Player shortcuts To adjust the size of the step, made when jumping back/forward: --step <seconds> option
  36. 36. Charts builder
  37. 37. Charts builder Screen player allows you to investigate the load and busyness of the 'screen' terminal in visual mode – drawing the statistics chart. This facility enables you to compare busyness of terminal in different periods of time, assess rise and falls in terminal activity, make conclusions.
  38. 38. Charts builder Chart building functionality can be accessed by 'chart' task. Let us build a chart, showing the activity of the terminal, which was being logged. Let us save the image, produced to a file image.png, with size 800x100 Our image.png may look like this now:
  39. 39. Charts builder Google charts chart functionality is based on Google Charts service from Google Inc. [4]
  40. 40. Structure
  41. 41. Structure – Python executable module, uses “screenlog” Python package. A package encapsulates the Screen Player functionality. Consists of several modules. Inside of the Screen Player screenlog package Gathering tasks – modules with __task__ attribute
  42. 42. “ screenlog” package logging system Structure . . . Level filter . . . Handlers logger “screenlog.module_N” logger “screenlog.module_3” logger “screenlog.module_2” logger “screenlog.module_1” logger “screenlog” screenlog module_1 module_2 module_3 module_N
  43. 43. Code documentation
  44. 44. Code documentation Doctests Screen Player code is well documented, doctests are included in the code into the docstrings. Screen Player offers an uility to test all the modules of “screenlog” by once:
  45. 45. Code documentation Epydoc Screen Player supports 'epydoc' documentation, it enables you to generate documentation in PDF or HTML format For example to generate HTML documentation for “screenlog” package, install Epydoc [5] and type:
  46. 46. Questions
  47. 47. Links <ul><li> –
  48. 48. Screen Player source code.
  49. 49. - Screen man page
  50. 50. - Protocol Buffers project page
  51. 51. - Google Charts dev's guide
  52. 52. - Epydoc project page </li></ul>