Your SlideShare is downloading. ×
Screen Player
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Screen Player


Published on

Purpose of creating Screen Player,, …

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
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Screen Player Bogdan Klichuk © Quintagroup 2009
  • 2. Table of Contents
    • Purpose
    • 3.
    • 4. Adapting to screen's logging system
    • 5. Player in action
    • 6. Charts builder
    • 7. Structure
    • 8. Code documentation
  • 9. Purpose
  • 10.
    • Playback of the logs – simulating the original interaction of the user and terminal, recorder by 'screen'
    Purpose - load - tempo - speed Input echo Record Playback Screen player screen
  • 11.
    • Explore logs, navigate, have control on the playback's behavior, like using the media player
  • 12. Demo
  • 13.
    • Investigate terminal activity and busyness, compare, generate charts for visual investigation
  • 14.
  • 15. is a Python utility, enabling you to access all the Screen Player's functionality rapidly Works with Python >= 2.5
  • 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. 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. Adapting to screen's logging system
  • 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:
    • Uses time stamps, built into log file by 'screen'
    • 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. Screen Player can be adapted to the
    • 22. format of the screen's time stamp.
    • 23. Here's the example of default
    • 24. screen's time stamp: [2]
  • 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:
    • Python pickle format
    • 26. CSV
    • 27. Protocol buffer 2 [3]
    • 28. (Language,platform independent)
  • 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. 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. 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. 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. 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. 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. 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. Charts builder
  • 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. 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. Charts builder Google charts chart functionality is based on Google Charts service from Google Inc. [4]
  • 40. Structure
  • 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. “ 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. Code documentation
  • 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. 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. Questions
  • 47. Links
    • –
    • 48. Screen Player source code.
    • 49. - Screen man page
    • 50. - Protocol Buffers project page
    • 51. - Google Charts dev's guide
    • 52. - Epydoc project page