JMeter test script for layered navigation

I’ve been doing a lot testing with JMeter lately for Magento.  I really do like it (Magento and JMeter).  It may not be the bestest, most perfectest tool in the world, but a) it’s free, and b) it’s stupid easy to get complex tests running.  But sometimes it’s nice to have some templates available to get you started.

As an example, I’ve been doing some testing with Solr and layered navigation in Magento.  One of the things I wanted to try was to randomly select attributes.  Oftentimes testing is way too predictable and so some element of randomness might help induce unusual scenarios.

One of the things I would like to do more of is share some of these testing scenarios.  Obviously, given my work with Magento’s ECG I can’t share some of the more complex things I do but I don’t mind sharing some of the simpler things.

This is an example of that.  This test will go to a particular page, as defined under the User Defined Variables node on a given domain (also defined there) and pull out a random URL from the layered navigation pane.  It will then search the resulting page for another link to click.

I highly suggest using the JMeter Plugins Extras Set in conjunction with this.

Download Random Layered Navigation JMeter Test Script

JMeter Error in NonGUIDriver java.lang.NullPointerException

Was doing some JMeter testing today when I got this error.

./jmeter -n -t ~/test.jmx 
Error in NonGUIDriver java.lang.NullPointerException

I had a JMX file that I copied to a remote server where JMeter was installed, and running before.  But this time when I ran it I got the exception.  Seeing that it was a GUi (or non-GUI) issue with no context I figured it was a GUI issue.

Turns out it was not.  The JMX file referenced a class kg.apc.jmeter.threads.SteppingThreadGroup which is part of the Extras Set at JMeter Plugins.  So despite the exception stating that the source of the exception was in the NonGUIDiver class the problem was that the Extras library was not installed.  I copied the jar file into lib/ext directory and the load test ran fine after that.

What being a foster parent is really like

I wrote this many months ago but never published it.  It’s a bit of a rant and I apologize for that.  To be honest I don’t really know why I’m publishing it.  Maybe it’s cathartic (the emotional definition, not the medical definition).  These are some things that I’ve wanted to say for a long while.  This is my opinion.  It is what I believe.  But I am open to the possibility of error.  This is my take on well over a half decade of trying to have children which ultimately culminated in my adoption of three children whom I love.  It was and still is the most difficult thing I have ever been through.  I hope that by sharing these thoughts you might walk away changed, if only a little.

Additionally, if I have written something here that offends you, bear in mind that you probably have not gone through what I went through.  This post is not shiny and polished.  It’s fairly raw.  Sometimes polish is needed and sometimes rawness is needed.  Would the Gulag Archipelago been as powerful if Solzhenitsyn had run it through the marketing department?  This post has currents upon under-currents which you probably will not understand.  So bear that in mind before sounding off in the comments section.


Normally I write about tech stuff.  This time you will find no code.  (I also apologize for the lack of rigid structure in the writing.  This was somewhat of a brain dump).

My wife and I are watching the TV show Once Upon A Time on Netflix.  I wouldn’t call it great, but it serves as entertainment when my mind has crapped out at the end of a hard day of typing.  The premise is that some evil queen in Storybookland curses the whole place and all of the characters end up in Maine not remembering who they are.  Snow White and Prince Charming, whose real name is James, apparently, hide their new baby in an enchanted tree where it is protected from the effects of the curse.  The down side is that the baby is transported to the same area and appears on the side of a road where someone picks her up and she is placed into foster care where she is bumped around from home to home until she ages out of the system and becomes a bounty hunter.  The show has spent some time throwing poo at the foster care system.

Before I was a foster parent this stuff didn’t really bother me.  Then I became a foster parent.  Now it does, a little.  What I would like to talk about in this post is what the foster system is like from the perspective of the foster parent.  Because, quite frankly, we get shit on a lot.

We have all heard horror stories about children in the foster care system.  They get bumped around from house to house.  They get split up from their siblings.  Evil foster parents use the children to get state money to support their gambling habits or worse.  I have also read stories about foster parents who have locked kids in refrigerators, closets, bathrooms or other places for extended periods of time after which some child is injured or worse.  I would not in any way justify the actions that lead to harm for the children, but I will tell you quite truthfully, almost every foster parent, save for the most saintly, has had to push aside rash thoughts for the sake of trying to get a moment’s sanity.  A very slim number of people actually do the rash things that we hear about, but every foster parent has had the moment when the temptation for rashness would have liked to take over.  Yes, I know that regular parenting has that too but for those who are doing foster care the levels of stress, regulation and frustration are much higher than with regular parenting.

Would you like to know why?

If so, continue reading with an open mind.

Getting Started

Many foster parents already have parenting experience, though many, such as my wife and I did not.  I was quite adept at getting children riled up before sending them home with their parents with the special needs ministry my (old) church has, but had no real parenting experience.  The kids loved me, the parents… well they put up with me because I gave them time away from their children to have a date night.  That was the extent of my parenting experience.

When you first sign up to be a foster parent you go through a bureaucratic anal probe the likes of which is only legal for the state to do.  They want to get to know the most intimate details of your life.  And rightly so.  You may have children who come into your home who have been physically or sexually abused.  So when they ask you if you are a sexually satisfied individual (and they will) or if you are in the middle of an adulterous relationship it actually is the business of the state to know.  Your spouse is not allowed to see your responses and I have heard of instances where a couple is denied a foster license because one of the marriage partners is having an affair and refuses to stop.  The application is denied with the other party not knowing why.

You go through other things like background checks and such, home inspections, fire inspections and a couple of other things.  But no significant problems notwithstanding you get approved and you are on your way to making a difference in these children’s lives.

And then you wait.

During the waiting period you need to keep up with your state training, .i.e. your State Mandated Indoctrination.

Does this training help you to be a  (foster) parent?

Heh, you could be so lucky.  The training is on state standards that you are expected to follow.

For those of you who are parents you may have taken some parenting courses that help you to understand how your child we be developing, dietary needs, when they should be approaching which milestones in their life, etc.  As foster parents we go to courses that teach us how to properly restrain a child.  I’ve had to do it (twice, I think).  Then you have a multi-page form to fill out where you explain what it was about, what alternate strategies you tried, why you thought that the child needed to be restrained.

The  medication training is perhaps the biggest time waste out of all of them.  8 hours of training once per year, probably on a Saturday.  Some people like to take their kids  to the park on the weekend.  Maybe the swimming pool.  Foster parents often spend a decent number of evenings and weekends attending useless training.

During the training I got to learn about the anti-psychotics and psychotropic medications that I probably will never be giving to children in my home.  And I don’t remember any of it.  Actually, that’s not true.  I have taken the course 3 or 4 times and here is what you will learn; 1) read the pharmacy information sheet, 2) lock up your meds.  That’s it. 30 hours of training and that is what I learned, remembered and have implemented.

Then there is the cultural sensitivity training.  This is presumably because a lot of foster parents are white (I have met several black foster parents, but where I live they are mostly white) whereas the population of the foster care system is largely Black or Mexican.  Yes, I didn’t say “Hispanic”.  Very few Spaniards are in the Texas foster care system.

Now, I am white.  I live in the suburbs (yuck! really).  I own a gas guzzling SUV that s bigger than I need (and smile every time I push the accelerator harder than I have to).  I have two big screen TV’s which I brought back to my larger-than-necessary house in my gas-guzzling SUV.  But I started out relatively poor compared to where I am now.  My parents provided a comfortable childhood and I had no want of anything.  But when I left home I lived month-to-month and had to hope that I had enough in the bank to pay rent.  I didn’t go to college but worked hard and eventually got married, moved to the U.S. from my home in Canada, started a business, failed at it, but kept working hard eventually landing some good contract work which led to a good job, which led to recording two albums and writing two books, which led to another job, which led to starting a business, failing at it again and landing another job for a great company.  I had great parents who set me up to be able to work hard and go from my rather modest first shot at living on my own to being relatively successful.

Until my world came crashing down and I found this out about my life


I had been wrong all of those years!  It wasn’t my hard work and long hours after all!

And not only had I received a benefit from racism, I found out that I was racist too!


Now, if you believe that all of this is true that’s fine, I won’t argue with you (you’d be wrong, anyway).  My purpose in writing this is to help you see what things are like as a foster parent.  In our state-based training I was being accused not only of having benefited from racism but as being racist simply because I am white.

Paperwork, Paperwork, Paperwork

Raise your hand if you like paperwork!  Each child requires at least one sheet of paperwork each week that shows daily progress.  These are called progress reports.  You are supposed to note pretty much any thing that happens to the child during that day.  This is because that paperwork is used to determine their level of care.  Their level of care determines what their subsidy is and what services are available to them.  If you get this wrong they may end up being mis-categorized and end up losing out on qualifying for services that they need.

And then you need to have medication logs.  Boys in the foster care system tend to be on medication, especially once they get past 5 years old. And for each of the medications that they are on you have a medication log.  One per medicine per child.  And if you screw up that is called a “medication error”.  And that’s bad.

Oh, and those one page progress reports I mentioned earlier?  That is only if your child is listed as basic.  Moderate and above you have three sheets of paper per child, per week.  In our case it was about 10 pages of documentation each week.

When normal parents have finished their day with a somewhat strong-willed child they might rest.  Read a book.  Watch some TV, maybe.  Well, with foster parents we are often dealing with children who are stealing, lying, fighting, self-injuring and a host of other things before breakfast.  And at the end of the day we do paperwork.

In theory.

In reality, paperwork is the last thing on our minds.  Because of the stresses that the children put you under along with the stress of knowing that what you do is under the eye of the state, at the end of the day you fall onto your bed, turn on the TV and hope that the next day is better.

You just drug the children up to make them more manageable

Yes!  In every way, yes!  Not as a default measure when they come into your house, but yes!

This is because many (most?) children coming into the foster care system are, in many ways, un-manageable.  Consider that these children come from environments where they rule the roost.  Many children brought into foster care were allowed to do anything they wanted as long as it didn’t interfere with what their parents were doing be it Meth, Cocaine, partner abuse or simple neglect.  From a child’s point of view, these kids have it made.  They can eat what they want, drink what they want, sleep when they want, do what they want.  As long as they don’t interfere with the caregiver, they can do anything they want.

My wife and I watched a documentary on Meth abuse several months ago.  The filmmaker got a surprise when a family of addicts allowed them into their house.  They were nice to them and honest about what Meth did to them.  They were actually quite contrite about what Meth had done to their family.  Their kids weren’t well behaved but largely did what they were told.

But it turns out that the parents were high during the interview.  A Meth high lasts about 6 hours and when you crash, you crash hard (apparently).  The parents slept off the high until 11:00 in the morning.

But their children weren’t high.  At 7:00 in the morning, the director cut to the two year old who had just woken up and whose diaper was sagging to his knees.  He walked over to the trash and pulled off some stuff on top and pulled a half eaten bag of popcorn out of the trash.  He also went to the fridge and got out a gallon of milk and did his best to feed himself.  A two year old.

Let’s presume that their parents have now been caught, the children have been removed and placed into a foster home.  Foster homes will probably have some kind of schedule because one or both parents work.  So the children will not be fending for themselves anymore.  They won’t have to dress themselves.  They will have meals at predictable times.  They will get tucked in at night.  They will be read stories.

Sounds like they should just take to it.

But they won’t.  This world is completely foreign to them.  The children have learned that in order to get a parent to do what they want they need to yell, scream, fight and hit.  Siblings do one of two things.  They either fight like maniacs because there is no parent to stop things before they get out of hand or they are incredibly close because they need to in order to simply survive.  Both are actually bad conditions.

The first is bad for obvious reasons.  With no parent to stop things they have not learned how to control themselves and God help you if you get in the way of a child who has needed to be narcissistic in order to survive.

The second can actually be just as bad, particularly for the eldest.  This child’s identity is as the provider for the family.  With the foster parent in place that child’s identity is removed and they, quite literally, do not recognize themselves and can react violently due to that loss of identity.

The way a lot of these issues work themselves out is into various psychological disorders such as Oppositional Defiance Disorder (think of the worst 3 year old ever in a 7 year old’s body), ADD/ADHD or Reactive Attachment Disorder are pretty common.  For boys in the foster care system the ADHD is virtually a given.  Each of those disorders I listed are have some basis in a lack of self control and are reactive in nature.

Drugs help smooth out the highs and the lows; that reactive nature.  It helps them become more manageable both for the foster parent and for themselves.  These children have had years in a toxic environment, the effect of which is often one or multiple behavioral disorders, they were just ripped from the people they love and put them in some strange house that actually has defined rules.  Before that their rules were do whatever you wanted as long as you don’t get beaten.  Now they’re expected to have self-control and they won’t have a fist print on their fact if they accidentally do something wrong.  So compared with the situation they came from, more is expected and the consequence of not doing what you’re told is much less severe.

Weeks, Months, Years

So you get one or more children in your home and it’s a matter of having the parents go through the treatment plan, passing an exam and sending the kids on their way, right?  Not even close.  Remember, many cases that CPS works with involve highly addictive substances.  Or in some cases the parents “really” are trying to get a job but just can’t quite get one that sticks.  But they have good intentions.

All of these things translate to delays.  Lots of delays.

And how much does the foster parent get to know why?  Zero.  For example, say you were planning a 10th anniversary weekend trip to Napa because you were told that the children would be back in their home weeks before then.  But they stay.  Then they stay a little longer.  You ask what is going on and you are told “oh, the parents are still working the plan.”  (You hear that a lot)

Your life is basically on hold while you have foster children in your home.  If you want to leave the state you need to get a judge’s permission.  We never had that request denied but it’s still a pain in the butt.  Say there was a family emergency and you needed to drive to the next state to help out.  You won’t be going until you have permission to take the children with you.  Respite care is, in theory, available.  But that often takes even longer to get than judicial permission.

So you wait and wait with no information about what is going on.  This is actually one of the hardest parts about the whole process.  Then at some point in the future you are told one of two things.  Either a) parental rights are going to be terminated and they are going to start looking for family members, or b) these children who you have been loving and parenting for the past year are going back, probably to a situation that is less than ideal.  If it is termination then family members have 90 days to come forward and claim the children.  Each family needs to get a home study done, which takes several weeks.  And if they pass (they often don’t) then you start preparing the children for their move to the family member.

But if nobody comes forward and the 90 days pass then you, as the foster parent, are first in line.  If you choose to adopt then you get the case file where you find out that the parents weren’t actually “working the plan”.  They didn’t stay clean, they weren’t attending parenting classes (like that would help), they were still hanging around with the people that they got caught with and there really was no chance that the case would be resolved.  But, a year is a year and you wait the year because that is what you are expected to do.

But don’t they love their children?

Ah yes.  Don’t these parents love their children and children need to be with their birth parents?

I have kept every Adoption or Legal Risk broadcast I have received and it is in the several hundreds.  In preparing for this blog post I read through the removal documentation for some of them.  I couldn’t read through them all because of the disgust in reading what those parents did to their children.  Here is a sampling, redacted.

  • Parent was robbing a store while intoxicated and on drugs.  Children left in car
  • Sexual abuse by boyfriend.
    • This comes up a lot.  Boyfriend or family members.  Often the reports provide details of who, where and with what.  Think about what it’s like to read the “what”.
  • Mother tested positive for Cocaine during delivery
  • Neglect, parents engaged in drug abuse and domestic violence (this one came up a lot)
  • Physical abuse (broken bones, burns, cuts)
  • Was pushed on the ground and rolled over by their parent with a stroller
  • Mom threatened bodily harm against a newborn
  • Abandoned
  • Parent convicted of human trafficking

And when I say “sexual abuse” let your imagination run wild.  Think of the worst things you can think of and much of it is in there, sometimes done to babies.


Read that sentence again.


Now, stop and consider that those kinds of things are probably happening to real children within driving distance of your home.  Go to Google Maps, put in your address and look in a circle about an hour or two around your house.  It is likely that in that circle there are several young children who are being sexually abused, more that are physically abused and many more who are neglected due to parental drug use.

This leaves behind all manner of disorders.  Compulsive masturbation.  Post Traumatic Stress Disorder.  Reactive Attachment Disorder.  Self-Harming.  Sexual Acting Out.  Oppositional Defiance Disorder.  Developmental Delays.  Never mind the burns, the scars and the broken bones.

These are not examples I came up with off the top of my head.  I read through several of the broadcasts and wrote them out in that last list.  This is real life for many children.

And during all of this you are supposed to be talking up their parents so the children won’t have a negative view of their them.  You know that woman who was caught having sex with a child molester to pay for the drugs she needs to buy from the drug dealer who is also the father of her first child who isn’t around and now has 4 other children with three other women and who has regularly beaten her for non-payment?  Ignore all that.

Let’s talk about money

Foster parents do it for the money.  Yeah.  To pay for the anti-depressants and therapy you need from dealing with the children (that’s a clumsy attempt at a joke).  A basic child gets you several hundred dollars per month.  Moderate children get above $1000.  Truth be told, yeah, foster parents actually get paid pretty well.  Too much, in my humble opinion.  But I can tell you that from all of the people I know who have fostered exactly none of them (as in zero) did it for money.  None of them needed it.  Outside of our foster group my wife and I had around a half dozen personal friends who were fostering.  None of us needed the money.  In our foster group, none of us needed the money.  We all fostered (and adopted) for various reasons of which money was never even a factor.

It is true, though that many foster parents need the compensation.  But taking a second job is a lot easier than taking on more children.  You have to get to three children or above if you want it to make a significant impact on your budget.

And it still doesn’t cover the cost of hair transplants to replace the ones you’ve lost.

Losing it all

The people who are lowest on the totem pole are the Straight Adoption people.  These are often people who are dealing with infertility, just want to provide a child a good home without going through the pain of fostering.  My wife and I were straight adoption for two years.  We even submitted for a group of 7 children at one point.  Thankfully we were not approved for that one.  But we submitted for several others.  In two years we came close maybe two or three times.  But we never wanted to go the foster route.  We did not want to fall in love with some kids only to have the state place them back with their parents.  Or have the parents fail and then have the kids placed with a relative.

Because, you see, straight adoption families are lowest on the totem pole.  The order goes

  1. Parents
  2. Close Family Members
  3. Out of State Family Members
  4. Current Foster Parents
  5. Satan
  6. Straight Adoption Families

So we decided to switch our status to foster-to-adopt.  We went for a little while but then got a temporary placement with a boy before he was adopted and did respite for some kids.

And then December 24th, Christmas Eve, 2010 came.  We got the call that a baby with a leg cast and a fractured skull needed a home.  I told my wife “my first inclination is to say no”.  I didn’t really want a baby.  But I acquiesced.  We agreed and a few hours later a car arrived.

When most people become parents they have about 9 months to prepare.  Our average time is around 3 hours.

I opened the door for the investigator and he said “here, hold this” (I actually really liked this investigator).   I looked down at “this” and saw the biggest, bluest eyes I have ever seen.  I went from wanting to have nothing to do with babies to being wrapped around her little pinky finger in about 3 seconds flat.  In that moment I became the Dad of a beautiful little baby girl.  She was our Christmas Eve miracle.

She had us both.  It didn’t matter that we didn’t have 9 months of anticipation.  We were so love-struck by this little thing.  We loved her like she was our own.  We got up at all hours of the night to feed her.  We changed her.  We wiped the poop off of her cast (due to physical abuse).  We would sit there and rock with her and just enjoy her presence.

But we knew that we were still just foster parents.  And what do you as foster parents do when you get a child you fall in love with?  You get on Facebook.  You try to find who the parents are.  You try to find out who the relatives are.  You try to figure out which family members are bums and which ones could possibly be a threat to the child.  You check online court documents.

I was actually pretty good at it.  I figured out who the parents, grandparents, baby-dads, former baby-dads, cousins, uncles and aunts were.  And when it comes to people with CPS records, that is not easy to figure out.  I figured out all of the possible avenues that our little girl could be taken away from us.

In all my searching I found only one person who could possibly take our little one away.  But we were told by CPS that there was a person but that nothing really promising was there.

But then on Feb 18 at 10:37 I received a reply to an email to our caseworker asking what happened to the person .  Our caseworker said that she was out but that another person wanted to be considered.  I, quite literally, was on a knife edge.  I was about two seconds away from picking up my desk and throwing it out the front window of my house (no joke).  We had worked through almost all of the potential people and they had all fallen through and then this new one came up.  I tell you the truth when I say that I almost destroyed my office in a fit of rage.

Later the caseworker came to our house for our monthly visit.  The first thing I asked her was “Is it X?”.  Her jaw dropped.  The one family member who I was most worried about was the one who had come forward.

It took about a month but it wasn’t long before our little Christmas miracle was gone.  And we were devastated.  I was in the middle of a work project and I couldn’t leave work, but we held it together for three weeks and made a bee-line for Breckenridge, CO where a very nice couple allowed us the use of their condo to recuperate.  But instead of recuperating we got, ahem, slightly inebriated, and had to head home early.  Apparently if you’re drinking to forget you shouldn’t do it at 10,000 feet.

When you are a foster parent be prepared to be devastated.  Devastation will occur at some point.  This is doubly true if you are hoping to adopt.

As difficult as that was we actually ended up becoming good friends with the girl’s new parents.  We go and visit them any chance we get.  In retrospect, our home was the wrong home for her.  And if she had stayed with us we would not have taken in any more children and we would not have gotten to adopt the kids we now have.  The bitterness is gone and in place is a new friendship with a very good family.  However  the road there was quite dark.

Do you want to be a foster parent?

I hope not.

I really hope you do not want to be a foster parent.

If you want to be a foster parent then you should not be a foster parent.  What happens when your “want” changes?  You need to believe that it is your duty to be a foster parent.  From the state’s perspective we were the worst kind of foster parent.  Our reports were always late, often in-accurate.  We (mostly me) left our training to the last minute and sometimes afterwards.

But from the moral perspective we were the best kind.  For every child who came into our home, few though they were, we committed that as far as it depended on us, we would be their last foster home.  We invested emotionally in their lives and paid deep, deep prices for that investment.  We are emotionally scarred and beaten.    We made ourselves vulnerable so our children can heal, grow and prosper.  We have fallen short of this ideal many, many times (and still do) but we have kept at it.  And we are not unique in this regard.  Every family we know who has fostered has had this kind of attitude.

If you are not prepared for that level of commitment and having your heart broken by child, parent and state, multiple times over, then you should not be a foster parent.

Likewise, if you are unwilling to commit to that level and having your heart broken by child, parent and state, multiple times over, then you have not earned the right to criticize a foster parent when you hear that someone did something horrible on the news.  Foster parents, even the bad ones, have had their life disrupted in ways that you cannot imagine.  They are put under scrutiny and pressure like you will never have to deal with.  Acknowledge those incidents for the evil that it is but know that there is a back story that most probably consists of pain and frustration that will never get reported.

What needs to be done?

That is always the question isn’t it?  “How do we fix it?”  Well, in many ways you can’t.  Evil exists in the world.  Evidence of it fills a folder in my email that has those broadcasts, named “Adoption”.  It will always be there.

But while you can’t fix it here are a few suggestions that could reduce it.

(Actually) do something about poverty

In almost all of the documents I have, poverty is a significant factor.  Not in all cases, but in many.  But the underlying problem in almost all of them is not the poverty itself.  The poverty is a symptom, but it is not the cause.  Almost all of the cases I have in my email folder are people who come from broken families.  In many cases there are not fathers, there are boyfriends.  When there are fathers they are usually not married.  See, what we’ve done over the past 50 years is do our best to destroy the one social institution for which the absence is virtually guaranteed in all of these cases.  You may say that I’m attempting to prove a negative here, and you might be right.  But almost every bit of social science shows that a strong family is one of the best stabilizing factors for children.  I know who my Dad is and where he was for my childhood.  Given the immense effect he had on my life (despite my stubbornness against it) I cannot even imagine the person I would be today if he was not committed to the death to my mother.  And I am committed to death to my children’s (adopted) mother.  My kids will never have to wonder if I will come back if I leave, or if they might have a half-sibling out there (due to me).  Just like I didn’t have to worry about it with my father.  My father worked for his family as I work for mine.  Why?  Because my family is my personal responsibility.

But seldom (if ever) do the CPS treatment plans include this kind of training.  To my knowledge (and I could be wrong) the information about what happens to children when father’s leave them is not presented.  Maybe it is.  But in the training material that, as the foster parent, completed there was no mention of the the stability that a strong traditional family has.  That stability may not solve the problem of poverty; there will always be poverty.  But what it does is keep poverty from being a sentence handed down.  Poverty, itself, is a problem.  But a bigger problem is the recurring chain of poverty.  “Programs” will have only a minimal effect on that.  And given the focus of those programs, if I were a betting man, I would bet that in aggregate they do more harm than good.

Put poison pills in CPS treatment plans

A poison pill is basically a guaranteed consequence.  For example, in Texas parents have a year to get their act together and do their treatment plan with the judge having the option to push it to 18 months if they “just need a little more time”.  But CPS says that if parental rights need to be terminated that they(CPS) have failed.  In that case, they have a 70% failure rate.  30% of removed children go back to the parents and do not re-enter the system after 12 months.  That is the extent that CPS monitors the family.

In the case of drugs they usually need to be clean for a minimum 6 months before re-unification.  Perhaps for something like Marijuana nothing needs to be done (I’m not personally convinced that it should be outlawed, but don’t care much either way).  However for Cocaine, or especially Meth, if they fail after 6 months there is almost no point in continuing.  The Meth relapse rate is officially 92%.  If they fail in that 6 month time period they will likely not succeed at all.  Why put their children through a minimum of 6 months of additional uncertainty?  In our situation the last 6 months were filled with the most promises, the most lies and the most damaging behavior from the children because of that.  While I am personally in favor of re-unification in a general sense, I also don’t think that drawn out treatments that are virtually guaranteed to fail should be pursued.  It’s not fair to the kids, the parents, the foster parents and the CPS workers who have to deal with this.

The other side of this is that most CPS workers are massively overworked.  If there are cases in the system where failure is virtually guaranteed then let’s get those failures out of the way to reduce their caseloads.  One of our caseworkers had 70 open cases.  The CPS case worker has something like a 20-30% turnover rate year over year with most case workers not lasting 5 years.  We really need to make their jobs easier because good case workers are really hard to find.

Put kids in the bestest, quickest home, fast

This notion that kids automatically do better in a family placement is ridiculous.  Several of the cases we were involved in were failed family placements.  But going beyond that consider how far removed someone needs to be to escape the culture of poverty.  The state has what is called Minimum Standards.  For kinship placements, those standards are very low.  Yes, the children may be familiar with the people already (definitely not a guarantee) but that is exactly the problem.  How many of the children in these kinship placements end up being in CPS cases in the future?  I understand that we want to minimize the placement disruption but we can’t do so to the long term detriment of the children.  How many of these children could be truly given a new lease on life by removing them from the culture that would have doomed them.

And do it quickly.  If a caseworker has a file in hand of a willing family who is unrelated and there is an out of state family member who needs to get a homestudy done (who probably has never had significant contact with the children anyway), just give the children to the willing family instead of waiting months to satisfy the mumblings of some psychologist.

Seriously, don’t treat Foster parents like babysitters

As hard as caseworkers have it they have one benefit.  In the 70 cases they have, they have the luxury of not developing strong emotional bonds to the children.  That’s not to say that they don’t feel for them, but they don’t bond with the children in their cases.  Foster parents get emotionally invested in their foster children in a big way.  For babies we are up several times a night to feed and change a child who is not our own.  We deal with children who have behavioral issues that kids from solid backgrounds do not.

Yes, we get paid to do it.  But if a babysitter screws up they might lose a client.  Maybe two.  Foster parents lose their license and quite possibly the ability to adopt in that state and maybe the country.   CPS does not need proof to revoke your license.  The children we eventually adopted were brought to our home because there were “suspicious” bruises from the first foster home.  There was no direct evidence of abuse and there was never any “outcry” but they were removed anyway.

Be careful what you believe about foster care

Remember that reference to Once Upon A Time where the main character was bumped around in the foster care system for 18 years?  Bullshit, I say.  She was a white baby girl.  She would have been adopted before the week was out.  That NCIS shrink who complained about the “cash checkers” who were his foster parents?  1-6 months, depending on his age, level of care and expediency of the court.

Kids get bounced around the system because foster parents get burned out (yes, I am sure that there are negative examples in many cases).  In many cases they have their existing children that they need to care for.  Sometimes they may fear for the safety of their own kids because of the children they are fostering.  Often they don’t have the necessary support.  Often they are simply unprepared for the level of care that these children need.  It is not some diabolical scheme to hurt these kids.  Foster parents get burned out, hard.  Siblings get broken apart because taking on multiple children is an immense drain.  My wife and I took on three at once, whom we eventually adopted.  When you get those kids you are not simply babysitting.  You are taking them into your family.  These kids, at best, will be developmentally delayed.  You will have a 5 year old acting like a 3 year old and a 2 year old acting like a baby.  That is, in every way, exhausting.

Then you also need to work your schedule around parent visits, therapists and home inspections.  Home inspections happen at least once a month by both your agency and CPS.  Parent visits are where you drive the kids to either a CPS office or some other place and drop them off, find something to do for two hours and then pick them up.  The kids are all excited because they got presents and played the whole time, probably getting totally sugared up and you get to hear about how wonderful the bio-parents are for the next day or two.  And parent visits are inevitably followed by a day or two of acting out, whatever that means for the child.  Could be defiance, pooping in strange places or sexual acting out.

Then you have the therapy visits.  When we were doing the most we had at least 5 therapy visits per week.

Foster parents don’t sit through that bureaucratic anal probe with a smile on their face because they like it.  They do it because they really want to help these kids.  Foster care is one of the hardest things you can do.

And you go through it hoping that whatever little contribution you provided will be enough to keep the cycle from repeating.

What is the last event fired in Magento?


What is the first event fired in Magento?


Technically, it’s resource_get_tablename, but the first usable event is controller_front_init_before.

But this is also a bit of a trick question.  controller_front_init_before is ONLY triggered from the global area.  The first usable event in the frontend (or adminhtml) area is controller_action_predispatch.  core_locale_set_locale might also be a possibility because it is set when the area is loaded, but I would say that controller_action_predispatch is still the best, first usable event once the area is known.

4 charts that are guaranteed to make you a better performance detective

I was giving the Magento Performance and Optimization for System Administrator’s course today and I said something that is either borderline brilliant, stupid, or common knowledge.  What I said was something along the lines of “finding performance problems is about finding a) correlations, or b) deviations“.  In other words, a big part of determining a performance problem, especially when using instrumentation data as opposed to reviewing code, a prime goal is to find data that correlates or deviates.

To illustrate this I rendered 4 charts top illustrate what I meant.



What I mean by this is that when you are determining performance problems whose cause is not readily apparent you should be looking for data that correlates either inversely or proportionally (top row) or deviates (bottom row).

What do you think?  We must always grant that there will be cases where this is not true.  However, it seems that it many scenarios finding either a) correlating data, or b) deviating data gets you about 3/4 of the way to discovering the source of a performance issue.

On the state of software development communities and industry

[Post redacted due to concerns that any tenets deliberated or propositions discussed will be intentionally misrepresented or used as reductio ad ridiculum and may be used as fodder for personal attacks, loss of standing or accusations of misconduct]

I’m actually really excited about Hack and HHVM

When you get to be my age you start thinking about the future.  You start wondering if some of the choices you made when you were younger.  You wonder if those choices are going to come back and haunt you.  If you don’t have such thoughts you are either an idiot, or a young person without enough experience to make you think such things.

One of the things that I have been wondering about is whether my decision to focus on PHP several years ago was the right one.  Technology is always changing and eventually the guys writing Ruby, too, will start having children and then will start looking down upon people who use disposable diapers instead of more environmentally friendly cloth instead.  In other words, times change and one of the keys to navigating change is to know what to change, why to change and when, if ever, change is necessary.  Change for the sake of change is stupid.

There are several changes that are occurring in technology.  But one thing that has not changed has been the venom that PHP has been on the receiving end.  Much of the venom is, in fact, deserved, though the quantity by which the venom is spewed is not.  If you are the source of 75% of the traffic on the Internet then you might be doing something right.  But that 75% is today.  What about tomorrow?

And so my question has been “will there be enough innovation in PHP to keep it a force to be reckoned with several years down the road?”  I ask this because there are market and technology changes occurring that PHP is not well suited to navigate.

But before you think that I am totally down on PHP that is not quite true.  PHP was a revolutionary force when the web first came out.  It, and not any other programming language, democratized the web in a way that was not otherwise possible at the time.  But with the web won PHP kind of sat on its laurels for a bit.  Because of this several different languages have gained a foothold.  While PHP won the initial battle for the web (and did it convincingly) it did not protect its flank through continued innovation.  Innovation occurred to some extent, but PHP did not really mature.  In fact, I would argue that Ruby did what market forces are supposed to do to competitors ; forced them to step up them game.

And PHP did.  Within the span of just a few years framework after framework shot up.  The running joke was Q: “How many frameworks are there today?” A “That depends.  Is it Wednesday or Thursday?”  Ruby threatened and PHP responded.  Symfony, Zend, Laravel, Cake and a host others that I am not listing matured the PHP community very quickly.  What was once a hack language grew into a much more mature ecosystem.

But again, PHP seems to have stagnated a little.  There have been several people who have noted dis-function in PHP internals.  I’m not involved that close with that and so I have no definite statement I am willing to make.  However I have been concerned and what I am perceiving to be a slowdown of innovation since PHP 5.3 came out.

But the hack language may be on the verse of another jump forward via the Hack language and the HipHop VM.  While I, as a metalhead, object to the naming of the aforementioned VM with the release of version 3 we may be seeing something that could possible extend PHP’s life by 10-15 years and introduce another round of innovation for PHP.

With version 3 the excitement is almost palpable.  Davey Shafik and Padraic Brady have written blog posts recently that are the source of my optimism.  Resource utilization is a significant concern of mine at Magento (where I work now).  Magento does some really great things but does them at a fairly significant cost of CPU time.  If you’ve played with Customer Segments in EE you know what I’m talking about.  or, for that matter, rendering the layout.  When I was working at Zend I was constantly asked “what switch do I need to make PHP faster?” and an opcode cache can only do so much.  With Hack and HHVM that, quite literal, is a possibility.  In the spirit of full disclosure, I have not had a chance to play with it in depth and I hope to be able to soon, but the potential is there.

And that potential is something to be excited about.  Facebook has demonstrated significant resolve in building the HHVM.  It, like PHP to begin with, was built to solve a real problem; the problem of moving an old language into new times.

And maybe, just maybe, solving that problem will help keep PHP in the position it is in.  Maybe an old dog can be taught new tricks.


Now if only someone could provide my wishes of core low level event APIs and easy messaging integration.

assertTrue( ): Amazon: The Everything Company

If you’re thinking about putting your company’s Web presence on Amazon’s computers (using EC2), you might want to ask yourself a few questions. Does Amazon already compete with your business in any way? How long before Amazon does compete with you? Do you want to put your online business in the hands of a potential competitor? Do you want Amazon to know more about your business than it already does? No one’s suggesting Amazon is actually going to spy on your business’s bits and bytes (which are already encrypted anyway, right?), but they can learn a lot simply by knowing your capacity needs, your business’s Web traffic patterns, your scale-out and failover strategies. Just by metering your Web usage, they know too much.

via assertTrue( ): Amazon: The Everything Company.

Magento memory utilization for backend work

I was talking with a colleague about my previous blog post on memory utilization in Magento and he noted that I had not taken into account backend tasks.  Which he was right about.  So I decided to take a second look at the memory usage from the point of view of the admin UI.

But before we do that, let the caveats begin!  Firstly, this was with the sample Magento dataset.  Second, there were no additional modules (beyond Aoe_Scheduler and Alanstormdotcom_Systemsearch).  Third, just because these numbers show low usage does NOT mean you should drop memory_limit down to 32MB.

Read the previous post to see the methodology.



Dataflow Export



Reindexing All Indexes



Saving a Bundled Product


Saving a Simple Product


Web Analytics